Kbd
A key on the keyboard, drawn as a small chip. It names the key of a shortcut so the reader can find it on their keyboard.
Reach for it
Naming the key of a shortcut, in a sentence or beside an action.
Not for
A value or a status, which is a Badge. A menu item takes its key through `shortcut`.
In a sentence
Write the key as it is printed on the keyboard. The chip sits on the line of text, so it reads as part of the sentence.
Press G to copy the instruction, or Esc to close the menu.
A combination
One chip per key, side by side. Beside an action in a Dropdown menu, pass the key to the item's shortcut rather than drawing a chip.
⌘K
API reference
Kbd
| Prop | Type | Default | Description |
|---|---|---|---|
| children* | ReactNode | - | |
| data-testid | string | - | Names the element for a test. Never rendered, never announced. |