Kbd
A component to display keyboard shortcuts.
⌘⇧⌥⌃Ctrl+B
Installation
pnpm dlx cubix@latest add kbd --base ariaUsage
import { Kbd, KbdGroup } from "@/components/cubix/kbd"<Kbd>Ctrl</Kbd>
<Kbd>⌘K</Kbd>Basic
Ctrl⌘KCtrl + B
Modifier Keys
⌘C
KbdGroup
Use KbdGroup to group related keys together.
CtrlShiftP
Use Ctrl + BCtrl + K to open the command palette
Arrow Keys
↑↓←→
With Icons
With Icons and Text
LeftVoice Enabled
Input Group
Compose Kbd inside an InputGroup addon.
Tooltip
Show keyboard shortcuts inside a tooltip.
With samp
Wrap sample output in <samp> when the key represents a program or file name.
File
API Reference
Kbd
| Prop | Type | Default | Description |
|---|---|---|---|
| className | string | - | Additional Tailwind classes merged with the component styles (last one wins). |
| children | React.ReactNode | - | The key label, icon, or combination to display. |
KbdGroup
| Prop | Type | Default | Description |
|---|---|---|---|
| className | string | - | Additional Tailwind classes merged with the component styles (last one wins). |
| children | React.ReactNode | - | One or more Kbd elements to group together. |