sheengemologic ui
All components

ShortcutProvider

Owner-scoped chord and sequence dispatcher with usePendingShortcut feedback.@gemologic/sheen · application

Playground

This example has no scalar controls. Its validated source remains interactive below.

Workspace

<ShortcutProvider development={true}><p>Workspace</p></ShortcutProvider>

Variant matrix

Keyboard owner

Workspace

Anatomy

Package
@gemologic/sheen
Source
packages/ui/src/primitives/ShortcutProvider.tsx
Tokens
None

Accessibility

Role: noneKeyboard: Registered chords

Do

  • Use useShortcut inside an owned child component.
  • Keep platform and development configuration stable for the provider lifetime.

Do not

  • Do not infer backend or modal state from this provider.
  • Do not register reserved browser shortcuts or assume disposal cancels application transport.

Generated props

NameTypeDefaultDescription
childrenJSX.ElementOwned application content; one provider per document, no nested providers.
platform"mac" | "other"Optional mac/other override, read at construction. When omitted, resolve navigator.platform on mount before registering bindings. SSR and initial hydration expose an empty inventory, never provisional wrong-platform bindings.
development *booleanRequired collision policy, read at construction: development throws, production warns and uses last registration.
activeScopesreadonly string[]Reactive outer-to-inner base scope IDs; default global. Focused ShortcutScope boundaries append outer-to-inner scopes. Open sheen dialogs override both with the newest active modal scope. Changes cancel pending sequences; non-sheen overlays must still manage their own isolation.
characterShortcutsbooleanAllow character-only single keys and sequences, default true. Wire to a user-facing preference. False retains bindings requiring Ctrl, Meta, Alt, or a non-character key. Changes cancel pending input; the app owns persistence.
onError(error: unknown) => voidReports synchronous failures and async rejections while their registration is alive. Matched defaults are prevented before execution. Disposed registrations consume late rejections without notifying a new owner. Without a handler, live errors are rethrown in a microtask.
Native Solid/HTML attributes remain available and are omitted from this authored-prop view.