Kbd
A keyboard key — the one place heyo-ui leans on monospace type.
⌘⌘KGthenD
Kbd renders a <kbd> as a keycap: monospaced and hairlined. It is the single
place where heyo-ui leans on mono type, because keycaps read better that way.
Usage
tsx
In a menu
The usual home for a shortcut hint is the right end of a row — a
Dropdown.Item or a
Command result.
Platform-aware shortcuts
Command.Shortcut spells "mod+k" as ⌘K on macOS and
Ctrl K everywhere else, using these same keycaps. Prefer it over hard-coding a
⌘.
Separators
separator is empty by default, which gives the tight ⌘K form. Pass a
character or a word for a sequence.
Ctrl+⇧+PGthenI
Properties
Kbd
childrenReactNodeoptional
The key. One glyph or one short word.
classNamestringoptional
Merged into the <kbd>.
Kbd.Group
separatorstringoptional
The character rendered between keys. It defaults to "", which gives the
tight ⌘K form.
childrenReactNodeoptional
The keys.