Shadcn Kbd
Browse 6 production-ready shadcn kbd components for displaying keyboard shortcuts, command hints, and hotkey references. Shadcn Kbd is compatible with Radix UI and Base UI components and is fully aligned with Shadcn Create style options so your previews match your design tokens.
For AI Agents
Hand your agent this brief or the ReUI MCP, not a screenshot. Free to install.
When to use
- Shortcut hints set beside an action name, in a tooltip or inside a search field
- Single keys and key combinations, as loose caps, a group of caps or keys with an icon
- Reference lists that pair each command name with its key chord
When not to use
- A searchable palette of actions the user picks from with the keyboard: use the Command component
- A ready made shortcuts panel with search and sections, sliding in from the side: use the Sheet blocks
- A status, tag or count shown as a small chip, not a key to press: use the Badge component
Agent notes
- No example listens for its keys:
Kbdonly draws the label, so bind each shortcut with your own keydown handler Kbdturns off pointer events and text selection, so it cannot be clicked, used as a hover trigger or selected
https://web.dev.reui.io/components/kbd.mdget_component("kbd")npx shadcn@latest add kbdShadcn Kbd: Keyboard Shortcuts and Commands
Shadcn Kbd is a semantic component for displaying keyboard keys and key combinations. It maps to HTML kbd semantics while providing Tailwind styling and Radix compatibility, and aligns with Shadcn Create style options.
It renders keyboard shortcuts, command hints, and hotkey references in a consistent, recognizable style so users discover keyboard navigation without tooltips.
ReUI lists kbd components in help sections, command palettes, and documentation so you evaluate spacing, grouping, and context next to a Shadcn Button or Shadcn Tooltip. The sections below cover what it is, why teams use it, and integration components.
What is Shadcn Kbd?
In UI terms, a kbd is a semantic element that renders keyboard key or key combination. Shadcn Kbd wraps the HTML kbd element with Tailwind styling so shortcuts look polished and recognizable.
Components here show single keys (Enter, Esc), modifier combinations (Cmd+K, Ctrl+Shift+P), and groups of related shortcuts. They help you decide key styling, spacing, and placement before documenting commands in help, settings, or command palettes.
Why Use Shadcn Kbd?
Kbds teach users about keyboard shortcuts without interrupting their flow. A quick visual reference (Cmd+K) is clearer than prose ("press Command and K together"). Teams use them in help sections, tooltips, and in-app command hints to make power-user features discoverable.
The layouts on this page combine kbd elements with Shadcn Button hints, Shadcn Tooltip, and Shadcn Command palettes.
Shadcn Kbd Features
- Semantic HTML. Uses the HTML kbd element so search engines and assistive tech recognize it as keyboard input.
- Single and Combined Keys. Display single keys (Enter) or combinations (Cmd+K) with proper spacing and separators.
- KbdGroup for Organization. Group related shortcuts together so documentation stays scannable and organized.
- Tailwind Styling. Background, border, and typography respect Shadcn Create tokens so keys match your design system.
- Integration with Buttons and Tooltips. Pair with Shadcn Button titles or Shadcn Tooltip content to hint at available shortcuts.
Integrating with Other Components
Add kbd elements inside Shadcn Button title attributes to hint at keyboard shortcuts. Use Shadcn Tooltip to display fuller shortcut hints on hover or focus.
Display kbd groups in a Shadcn Card help section or inside a Shadcn Dialog for a dedicated shortcuts reference. Pair with prose and Shadcn Accordion to organize shortcuts by category.
Use kbd in a Shadcn Command palette to show available shortcuts. Combine with Shadcn Input search to filter commands and links to actions.
Frequently Asked Questions
Should I use the semantic kbd element or just style text visually?
How do I display Mac (Cmd) and Windows (Ctrl) shortcuts together?
What is the best placement for keyboard shortcut hints on a button?
Can I render a kbd inside a tooltip or button?
Is the Shadcn Kbd component accessible for all users?
How do ReUI kbd components differ from a minimal single-key example?
Start building with ReUI Pro today.
Every Pro block, every style, and every future addition, with one license for unlimited projects.
From $249, once. Lifetime updates.