elementskbd-group
KbdGroup
Group of keyboard shortcut keys supporting simultaneous chords and ordered sequences.
Import#
Usage#
KbdGroup composes multiple Kbd keycaps.
Use items for keys pressed at the same time, such as Ctrl + K.
Use sequence for chords pressed one after another, such as Ctrl + K then Ctrl + S.
Slot Structure#
Examples#
Basic#
Sequences#
Custom Dividers#
Sizes#
API Reference#
Attributes#
Slot
root0 attributesContainer for one or more shortcut steps.
No attribute metadata for this slot.
Props#
| Prop | Type | Default | Description |
|---|---|---|---|
| class | ClassValue | — | Class applied to the component root or trigger element. |
| classes | KbdGroupT.Classes | undefined | — | — |
| dividerRender | ComponentOrElement<KbdGroupT.DividerRenderProps> | undefined | — | Custom divider rendered between keys in the same group. |
| items | KbdGroupT.Item[] | undefined | — | Keys pressed at the same time, such as Ctrl+K. |
| ref | JSX.HTMLElementTags["span"] extends { ref?: infer Ref; } ? Ref : never | undefined | — | — |
| sequence | KbdGroupT.Item[][] | undefined | — | Key groups pressed one after another, such as Ctrl+K then Ctrl+S. |
| sequenceDividerRender | ComponentOrElement<KbdGroupT.DividerRenderProps> | undefined | — | Custom divider rendered between shortcut steps. |
| size | "xs" | "sm" | "md" | "lg" | "xl" | undefined | — | — |
| style | JSX.CSSProperties | undefined | — | — |
| styles | KbdGroupT.Styles | undefined | — | — |
| variant | "default" | "outline" | "invert" | undefined | — | — |
Items#
| Prop | Type | Default | Description |
|---|---|---|---|
| label | string | undefined | — | Accessible label for assistive technology. |
| slotName | string | undefined | — | Data slot used by the rendered keycap. |
| symbol | boolean | undefined | true | Whether to resolve known key aliases to symbols. |
| value* | KbdT.Key | — | Value displayed by the keycap or resolved through the static key aliases. |