Usage
Examples
Single Key
Key Combination
In Text
Mac Modifiers
Common Shortcuts
Arrow Keys
Function Keys
Special Keys
Keyboard Shortcut List
In Documentation
Props
Key label or symbol
Additional CSS classes
<kbd> element attributes.
Styling
- Uses monospace font for authentic keyboard key appearance
- Includes subtle inset shadow for 3D effect
- Minimum width ensures consistent sizing
- Themed with muted background and border colors
- Small font size (
text-xs) for compact display
Accessibility
- Uses semantic
<kbd>HTML element - Screen readers announce keyboard shortcuts appropriately
- Clear visual distinction from regular text
Best Practices
- Use platform-appropriate modifier symbols (⌘ for Mac, Ctrl for Windows/Linux)
- Keep key labels concise and clear
- Use
+or visual spacing to separate key combinations - Consider showing platform-specific shortcuts dynamically
- Group related shortcuts together in documentation