ShortcutHelpSheet
A dialog that lists the keyboard shortcuts of the screen and runs an action when its row is pressed.
Import
import { ShortcutHelpSheet } from '@tallyui/components';Usage
Mount <ShortcutHelpSheet /> inside the screen's ShortcutProvider, beside the Catalogue and Cart. It registers the shortcuts.help action, so Alt+/ opens it.
<ShortcutProvider enabled={isFocused}>
<Catalogue />
<Cart />
<ShortcutHelpSheet />
</ShortcutProvider>Props
| Prop | Type | Description |
|---|---|---|
open | boolean | Controls whether the sheet is open; omit for internal state. |
onOpenChange | (open: boolean) => void | Called when the sheet requests a change in visibility. |
title | string | Dialog heading. Defaults to Keyboard shortcuts. |
mac | boolean | Use Mac modifier symbols. Defaults to platform detection. |
testID | string | Dialog test ID and row ID prefix. Defaults to shortcut-help-sheet. |
Behaviour
- The
shortcuts.helpchord, Alt+/ by default, opens the sheet. - Mount the sheet closed. A sheet mounted already open captures the listing before other components register, so every row shows as unavailable.
- The rows show the actions that were available when it opened, because the open sheet blocks every chord.
- Unbound actions are left out.
- Unavailable rows, and the help row itself, are disabled.
- Pressing a row closes the sheet, then runs that action.
- When
openis controlled, the parent must close the sheet in the same update as the row press; otherwise the row's action is dropped. - A row's action does not run while another overlay holds a
useShortcutBlock. - A row's action does not run while the provider's
enabledis false. - The keycaps show
⌥on a Mac andAltelsewhere.
Web and native
Native renders nothing and registers nothing.