Kbd
A key or a shortcut, in the village's mono face: for menus, tooltips and the command palette.
Press CtrlK to search the docs.
Installation
Or with the shadcn CLI, from the registry:
Usage
Sizes, and in a tooltip
size="sm" fits menus and tooltips. In the default tooltip, which is inverted, the key turns into a wash of the
tooltip's ink so it still reads on the dark surface.
Villages
The key takes the village's border width and small radius: thin and rounded in Konoha, square with a heavy edge in Iwa.
Press CtrlK to search the docs.
Press CtrlK to search the docs.
Press CtrlK to search the docs.
Press CtrlK to search the docs.
Press CtrlK to search the docs.
Press CtrlK to search the docs.
Accessibility
- A
<kbd>, which screen readers read as text. Spell keys the way people say them (Ctrl,Enter), or give the group anaria-labelwhen you use symbols such as⌘. - When the shortcut repeats a label that is already read (a button's name), hide it with
aria-hidden.
API reference
Kbd and KbdGroup, each a <kbd> taking its props and className. Kbd also takes:
| Prop | Type | Default |
|---|---|---|
size | "sm" | "default" | "default" |
kbdVariants({ size }) returns the key's classes.