TanStack
Hotkeys API Reference

ProvideHotkeysContextOptions

Defined in: HotkeysProviderContext.ts:56

Options for provideHotkeysContext.

Properties

appHotkeys?

ts
optional appHotkeys?: MaybeRefOrGetter<
  | Readonly<Record<string, AppHotkey<string, HotkeyChord | HotkeySequence | null>>>
| undefined>;

Defined in: HotkeysProviderContext.ts:69

Every app hotkey, from defineAppHotkeys. Read when the context is provided; later changes update the declarations.


customHotkeys?

ts
optional customHotkeys?: 
  | CustomHotkeys<Readonly<Record<string, AppHotkey<string, HotkeyChord | HotkeySequence | null>>>>
  | null;

Defined in: HotkeysProviderContext.ts:74

Starting custom hotkeys, such as saved data. Read once; the context owns the state afterwards. Invalid entries are ignored with a warning.


defaultOptions?

ts
optional defaultOptions?: MaybeRefOrGetter<HotkeysProviderOptions | undefined>;

Defined in: HotkeysProviderContext.ts:58

Merged with the parent context's defaults.


enabled?

ts
optional enabled?: MaybeRefOrGetter<boolean | undefined>;

Defined in: HotkeysProviderContext.ts:64

See HotkeysProviderScopeProps['enabled'].


exclusive?

ts
optional exclusive?: MaybeRefOrGetter<
  | boolean
  | {
}
| undefined>;

Defined in: HotkeysProviderContext.ts:62

See HotkeysProviderScopeProps['exclusive'].


onCustomHotkeysChange?

ts
optional onCustomHotkeysChange?: (customHotkeys) => void;

Defined in: HotkeysProviderContext.ts:76

Called with the custom hotkeys after every change, ready to save.

Parameters

customHotkeys

CustomHotkeys

Returns

void


scope?

ts
optional scope?: MaybeRefOrGetter<string | undefined>;

Defined in: HotkeysProviderContext.ts:60

See HotkeysProviderScopeProps['scope'].