Kbd
Keyboard shortcut display component with platform-aware symbols (⌘ on Mac, Ctrl on Windows).
Live Demo
Keyboard Shortcuts
SearchCtrlK
SubmitCtrl↵
CloseEsc
PreviousShiftK
In Buttons
Installation
Usage
Props
| Name | Type | Default | Description |
|---|---|---|---|
keys | string[] | undefined | Array of keys to display. Use "mod" for platform-aware Cmd/Ctrl |
variant | 'default' | 'outline' | 'ghost' | 'default' | Visual style variant (default, outline, or ghost) |
size | 'sm' | 'md' | 'lg' | 'sm' | Size of the component (sm, md, or lg) |
className | string | undefined | Additional CSS classes to apply |
Use Cases
Keyboard shortcut documentation
Hotkey indicators in menus
Command reference displays
Accessibility guides and instructions