The component can be imported via:
The hotkey prop accepts TanStack Hotkeys notation. Mod maps to ⌘ on macOS and Ctrl on Windows/Linux.
Use the isInverted prop for a dark variant, suitable for inverted or dark-mode contexts.
Set variant="plain" to show the shortcut as plain text without the key cap, for example as a hint inside a menu item or tooltip.
The component extends Text and uses the product-code text style. It scales to match the surrounding font size, so it works inline with headings and body text alike.
The component renders as a <kbd> element and can be placed inline with text.
Use the platform prop to force a specific platform's display, regardless of the user's OS.
PlumaKeyboardShortcut extends TextDefault:'kbd'
What element or component should be rendered.
The hotkey string to display (e.g., "Mod+S", "Mod+Shift+Z", "Control+Alt+D"). Uses TanStack Hotkeys notation where "Mod" maps to ⌘ on macOS and Ctrl on Windows/Linux.
Type-safe: provides autocomplete for all valid key combinations including single keys, modifier+key combos, and multi-modifier combos.
Whether to render the inverted (dark) variant.
Override automatic platform detection. By default, the component detects the user's OS and formats accordingly.
'keycap' draws each shortcut as a key cap; 'plain' renders the same keys as plain text,
e.g. for a hint inside a menu item or tooltip.