Kbd: Shortcuts
<KbdGroup /> splits a combo into one cap per key. A space starts a sequence, joined by separator. <Kbd /> with keys keeps the whole combo in one cap.
- Command palette
- CommandK
- Move line up
- OptionUp arrow
- Close
- Escape
- Go to dashboard
- GthenD
- Save, as one cap
- Command S
This adds the example as components/examples/kbd/shortcuts.tsx, together with the Kbd component and the HextaUI theme tokens it needs.
pnpm dlx shadcn@latest add https://hextaui.com/r/kbd-shortcuts.jsonTo add only the component, follow the Kbd installation.
Props in this example
The Kbd props this example sets, from the API reference.
| Prop | Type | Default |
|---|---|---|
keysKeys joined with +, like "mod+shift+p". mod is ⌘ on Apple devices and Ctrl elsewhere. Names such as alt, enter, escape, up and space become symbols or short words, and get a spoken name for screen readers. | string | – |
| Prop | Type | Default |
|---|---|---|
keysKeys joined with +, like "mod+shift+p". mod is ⌘ on Apple devices and Ctrl elsewhere. Names such as alt, enter, escape, up and space become symbols or short words, and get a spoken name for screen readers. Spaces separate the steps of a sequence. | string | – |
Every prop is in the Kbd API reference.
See them all, with keyboard support and accessibility notes, on the Kbd page.
- HotkeyParse, label, announce and match keyboard shortcuts, with ⌘ on Apple platforms and Ctrl everywhere else.
- useHeldKeysThe keys someone is holding down right now, shared by every subscriber through a single set of window listeners.
- AvatarUser photos with an initials fallback, status badges and stacked groups that collapse into a count.
- BadgeStatus labels with colored dots, removable tags that slide closed and counts that roll to their new value.
- CardA surface for grouping content, with three variants, edge-to-edge media, concentric radii and whole-card links.
- ChartRecharts charts with themed colors, a tooltip and legend that read labels from one config, and keyboard navigation with a visible focus ring.