Kbd
v0.16.0A keyboard key in shortcuts and instructions; KbdGroup for chords.
Kbd keys
Install
npx shadcn add @syncrobotic/kbd Also installs: @syncrobotic/cn
Overview
A key cap for shortcuts and keyboard instructions, alone or grouped into a chord.
When to use
- Shortcut hints in menus, tooltips and search fields.
- A keyboard reference list.
- Instructions like Hold Space to stop all.
Use something else
- A code value or ID: a <code> span in font-mono.
More examples
States and real uses. Each example is also a Storybook story and a visual regression test.
Kbd chord
Kbd arrows
Kbd in input
Kbd in tooltip
Kbd shortcut list
Kbd pressed
Kbd pressed live
Usage rules
- One key per Kbd; a chord is a KbdGroup without plus signs.
- Use the platform's symbols: ⌘ on Mac, Ctrl elsewhere.
- pressed shows the key going down (it sinks and its edge darkens) while its shortcut runs; useHotkeys returns which key that is.
Changelog
- 0.16.02026-11-19
pressedshows a key going down while its shortcut runs (it sinks and its edge thickens to the text colour, --motion-fast); useHotkeys returns which key that is. - 0.10.02026-11-18Radius 4 (radius-2xs), so a key inside a tooltip or an input keeps clear of the corner around it.
- 0.9.02026-11-17New.