[ @sdxc/ui ]
ShortcutList
The list a keyboard-shortcuts panel shows.
Installation
An ordinary dependency: install it, import the theme once, and import the component where it is used.
npm add @sdxc/uiimport "@sdxc/ui/theme.css";Usage
import { ShortcutList } from "@sdxc/ui";Renders the list's host <dl>, a two-column grid whose first column takes the actions
and whose second sizes itself to the widest run of caps.
Composition
The parts the component publishes, each a static property of the host.
ShortcutListShortcutList.ItemRenders one binding as a<dt>naming the action and a<dd>holding a cap per key.
Examples
<ShortcutList>
<ShortcutList.Item keys={keyComboGlyphs("mod+k", apple)}>{t("openSearch")}</ShortcutList.Item>
<ShortcutList.Item keys={["?"]}>{t("showShortcuts")}</ShortcutList.Item>
</ShortcutList>Props
Read from the component's own types, so every prop, every default and every allowed value is listed.
| Prop | Type | Description |
|---|---|---|
children | RemixNode | One ShortcutList.Item per binding, in the order the panel lists them. |
Also accepts everything in TagProps<"dl">.
ShortcutList.Item
| Prop | Type | Description |
|---|---|---|
keys | string[] | The caps to press, in press order, each already the glyph to print — a combo formatted for the reader's keyboard by keyComboGlyphs(), or a bare character. |
children | RemixNode | What pressing the keys does. |
Also accepts everything in TagProps<"div">.