TanStack

HotkeysProviderScopeProps

Defined in: adapter.ts:416

Scope props shared by framework providers.

Properties

enabled?

ts
optional enabled?: boolean;

Defined in: adapter.ts:434

Set false to deactivate this provider's scope, and the scopes of providers nested in it, without unmounting. Defaults to true.


exclusive?

ts
optional exclusive?: 
  | boolean
  | {
  allow: readonly string[];
};

Defined in: adapter.ts:429

While mounted and enabled, suspend hotkeys in every other scope, including 'global', except scopes of nested providers. Pass { allow: [...] } to keep other scopes active, such as 'global'. Use with scope, for dialogs and other overlays.


scope?

ts
optional scope?: string;

Defined in: adapter.ts:422

Scope for hotkeys registered inside this provider, active while it is mounted and enabled. Defaults to the parent provider's scope, or 'global' at the root. App hotkeys that declare a scope keep it.


suspendCharacterKeys?

ts
optional suspendCharacterKeys?: boolean;

Defined in: adapter.ts:448

While mounted, suspend document-level character key shortcuts across the app, including hotkeys such as K, ?, Shift+K, Space, or ['G', 'H'] that use only keys that type a character. Wire this option to a user setting so people who use speech input or press keys by accident can turn single-key shortcuts off for WCAG 2.1.4 (Character Key Shortcuts). Hotkeys with Control, Alt, or Meta, non-character keys such as Escape or F1, and hotkeys targeted at an element other than the body keep working. This option applies even when the provider sets enabled to false, and to every hotkey in the app, not only those under the provider. See HotkeyManager.suspendCharacterKeys. Defaults to false.