SearchCtrlK

  • ↑↓navigate
  • ↵open
  • escclose

Can’t find it? Contact us

keyboardHelp

The browser half of the keyboard help sheet.

tsx
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

typescript
keyboardHelp(options: KeyboardHelpController.Options): MixinDescriptor<HTMLElement>

Parameters

ParameterTypeRequiredDescription
optionsKeyboardHelpController.OptionsYesThe key, its label and group, and where the rows go.

Examples

tsx
<Modal id="keys" mix={[keyboardHelp({ shortcut: "?", label: "Show shortcuts", onChange })]}>…</Modal>

The events, constants and types its module publishes, each imported from @sdxc/ui/app too.

Interface

KeyboardHelpController.Options

Options for keyboardHelp.

MemberTypeRequiredDescription
shortcutstringYesThe combo that opens the sheet, e.g. "?".
labelstringYesWhat that combo lists as in the sheet.
groupstringNoThe group that combo lists under.
onChangevoidYesReceives the registry's rows and whether the keyboard prints Apple glyphs, once on mount and again whenever the rows may have changed.
@sdxc/ui

Can’t find it? Contact us