KbdGroup
Display a multi-key shortcut with shared styling.
Anatomy#
Separator content is inline and is not a theme slot.
Usage#
Use KbdGroup to display keys pressed together, such as Ctrl + K. It renders notation only; the application owns the shortcut listener. For a single keycap, use Kbd.
Key labels#
Each item in items is either a key string (resolved like the value of Kbd) or an object { value, ariaLabel?, symbol? }.
Known aliases resolve to symbol notation and spoken names. The group’s size and variant apply to every key.
Separator#
- String:
separatordefaults to"+"and renders strings as plain text rather than an icon name. - Component: pass a component receiving
{ index }(the index of the preceding key) to render custom JSX such as an icon; each position mounts its own instance.
separator is inline notation and is unrelated to the layout Separator.
Examples#
Basic#
Place the group beside the command it describes. Alias keys resolve to platform symbols by default.
Custom separator#
Pass a separator component when the separator is markup, such as an icon, rather than text.
API Reference#
Props#
Props for the KbdGroup component. Renders a <kbd> element by default.