Write the key as it shows on the keyboard: "⌘", "Ctrl", "Esc".
search-shortcut-hint.tsx
Shows a key or a shortcut in text, such as a search hint, a shortcut in a menu, or a key in help text.
Added Nov 8, 2026 · MIT + Commons Clause
$ npx shadcn@latest add @gelatin-ui/kbdWrite the key as it shows on the keyboard: "⌘", "Ctrl", "Esc".
import { Kbd, KbdGroup } from "@/components/ui/kbd";
export function SearchShortcutHint() {
return (
<p className="text-sm text-muted-foreground">
Press{" "}
<KbdGroup>
<Kbd>⌘</Kbd>
<Kbd>K</Kbd>
</KbdGroup>{" "}
to search, or <Kbd>Esc</Kbd> to close.
</p>
);
}KbdGroup. It has no plus sign.Kbd is the native <kbd>. It is not a button: it has no focus stop and takes no pointer events.
Kbd and KbdGroup set dir="ltr", so "⌘ K" keeps its key order on a right-to-left page.