Keyboard Input
Shortcut hint. Kbd swaps glyphs for the current OS — do not hard-code ⌘.
Modifiers
Boolean props render the platform key. Apple gets Command / Control / Option / Shift glyphs; other platforms get Ctrl, Alt, and Shift.
Combination
Stack modifiers, then put the trigger key in the default slot.
Small
Use small inside menus, command rows, and table cells.
In prose
Press ⌘K to open the command menu.
1
Press <Kbd meta>K</Kbd> to open the command menu.
Best practices
- Shortcut chips in UI chrome: menus, button suffixes, empty states. Long-form docs that narrate a shortcut can write the glyphs in text so a copy stays readable.
- Pass
meta,shift,alt,ctrl. Hard-codingCmd+Kis wrong on Windows and Linux. - Children are one key:
K,7,Enter,Esc. Do not lowercase, do not spell modifiers in the slot. - Punctuation stays outside the element. “Press K to open the command menu.” — the period is not a key.
KeyboardInputis the same export asKbd. New code should importKbd.