Shortcut
The keys of one shortcut, the glyph spoken by name.
<Kbd.Group>
<Kbd label="Command">⌘</Kbd>
<Kbd>K</Kbd>
</Kbd.Group>Draws a keyboard key on a keycap, alone or as one shortcut.
<Kbd>Esc</Kbd>pnpm add @usefragments/uiImport styles once from @usefragments/ui/styles. See the installation guide for framework and theme setup.
Import Kbd once, then compose its parts with dot notation.
Kbd.GroupKbd.ShortcutThe keys of one shortcut, the glyph spoken by name.
<Kbd.Group>
<Kbd label="Command">⌘</Kbd>
<Kbd>K</Kbd>
</Kbd.Group>Prop | Type | Default | Description |
|---|---|---|---|
childrenRequired | React.ReactNode | Not set | The key as it is printed: a glyph or a short word |
Group.childrenRequired | React.ReactNode | Not set | The keys of one shortcut, pressed together, as `Kbd` children. |
label | string | undefined | Not set | The key's spoken name for a glyph a screen reader cannot say. The glyph is then hidden from assistive tech. |
Shortcut.keysRequired | string | Not set | The shortcut by key name, joined with `+`: `"Mod+K"`, `"Mod+Alt+B"`, `"Shift+Enter"`. `Mod` is ⌘ on a Mac and Ctrl elsewhere; `Alt` is ⌥ and Alt. |
Shortcut.platform | KbdPlatform | undefinedothermac | Not set | Draw for this platform instead of the one the page runs on. |
Shortcut.tone | KbdTone | undefinedneutralon-accent | Not set | Each cap's tone; `on-accent` on an accent fill. |
tone | KbdTone | undefinedneutralon-accent | neutral | on-accent draws the cap on an accent fill: the accent darkened, an 18% ring and words in its on-fill ink. |