Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Twilio-labs/paste/llms.txt
Use this file to discover all available pages before exploring further.
Keyboard Key
KeyboardKey is a component that visually represents keyboard keys and shortcuts. It helps users identify keyboard commands in documentation, tooltips, and UI instructions.Installation
Usage
Single Keys
Display individual keyboard keys:Keyboard Shortcuts with KeyboardKeyGroup
Use KeyboardKeyGroup to display key combinations:Interactive States
Show visual feedback when keys are pressed:Disabled State
Inverse Variant
Use the inverse variant on dark backgrounds:Props
KeyboardKey
The keyboard key text to display (e.g., “Enter”, “Ctrl”, ”⌘”).
Sets the key identifier used to determine if the key has press styling. Should match JavaScript KeyboardEvent.key values. See KeyCode List for reference.
Overrides the default element name to apply unique styles with the Customization Provider.
KeyboardKeyGroup
Multiple KeyboardKey components representing a key combination.
Array of key identifiers that are currently active/pressed. Keys in this array will receive press styling.
Disables the key combination and applies disabled styling.
Enables visual press state styling for keys in the activeKeys array.
Visual variant. Use “inverse” for dark backgrounds.
Overrides the default element name for customization.
Best Practices
Do
- Use KeyboardKey to make keyboard shortcuts scannable in documentation
- Use KeyboardKeyGroup for multi-key combinations
- Keep key labels short and recognizable (“Ctrl” not “Control”)
- Use platform-specific symbols (⌘ for Mac Command key)
- Show the most common shortcut for each action
- Group related shortcuts together in documentation
Don’t
- Don’t use for text that isn’t a keyboard key
- Don’t create overly long key combinations (3-4 keys maximum)
- Don’t use inconsistent key naming across your product
- Don’t rely solely on keyboard shortcuts for critical functionality
- Don’t forget to document platform differences (Mac vs Windows)
Accessibility
- KeyboardKey uses semantic
<kbd>HTML element - Key combinations are marked up properly for screen readers
- Visual styling provides clear distinction from body text
- Disabled state is conveyed through visual styling
- Consider providing alternative text for symbol keys (⌘, ⌥, etc.)
Common Key Patterns
Windows/Linux Shortcuts
Mac Shortcuts
Related Components
- Tooltip - Show keyboard shortcuts in tooltips
- Inline Code - Display code snippets inline