keyboardHelp
The browser half of the keyboard help sheet.
import { keyboardHelp } from "@sdxc/ui/app";Usage
Binds the sheet's key on the <dialog> it is mixed onto, and reports the registry's rows on
mount, on every registry change, and as the dialog opens.
Signature
keyboardHelp(options: KeyboardHelpController.Options): MixinDescriptor<HTMLElement>Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
options | KeyboardHelpController.Options | Yes | The key, its label and group, and where the rows go. |
Examples
<Modal id="keys" mix={[keyboardHelp({ shortcut: "?", label: "Show shortcuts", onChange })]}>…</Modal>Used with it
The events, constants and types its module publishes, each imported from @sdxc/ui/app too.
Interface
KeyboardHelpController.Options
Options for keyboardHelp.
| Member | Type | Required | Description |
|---|---|---|---|
shortcut | string | Yes | The combo that opens the sheet, e.g. "?". |
label | string | Yes | What that combo lists as in the sheet. |
group | string | No | The group that combo lists under. |
onChange | void | Yes | Receives the registry's rows and whether the keyboard prints Apple glyphs, once on mount and again whenever the rows may have changed. |