TanStack
Hotkeys API Reference

AlpineHotkeys

Defined in: types.ts:125

Registrations, recorders, and reactive state owned by one Alpine component.

Properties

createAppHotkeyList

ts
createAppHotkeyList: () => AlpineHotkeyState<AppHotkeyListItem<AppHotkey<string, HotkeyChord | HotkeySequence | null>>[]>;

Defined in: types.ts:154

Read every app hotkey with its live status through .value.

Returns

AlpineHotkeyState<AppHotkeyListItem<AppHotkey<string, HotkeyChord | HotkeySequence | null>>[]>


createAppHotkeys

ts
createAppHotkeys: () => AlpineHotkeyState<Readonly<Record<string, AppHotkey<string, HotkeyChord | HotkeySequence | null>>>>;

Defined in: types.ts:152

Read the effective app hotkeys from provideAppHotkeys through .value.

Returns

AlpineHotkeyState<Readonly<Record<string, AppHotkey<string, HotkeyChord | HotkeySequence | null>>>>


createCustomHotkeys

ts
createCustomHotkeys: () => AlpineCustomHotkeys;

Defined in: types.ts:158

Read and change the user's custom hotkeys.

Returns

AlpineCustomHotkeys


createHeldKeyCodes

ts
createHeldKeyCodes: () => AlpineHotkeyState<Record<string, string>>;

Defined in: types.ts:139

Read the mapping of held logical names to physical codes through .value.

Returns

AlpineHotkeyState<Record<string, string>>


createHeldKeys

ts
createHeldKeys: () => AlpineHotkeyState<string[]>;

Defined in: types.ts:137

Read held logical key names through .value.

Returns

AlpineHotkeyState<string[]>


createHotkey

ts
createHotkey: AlpineCreateHotkey;

Defined in: types.ts:130

Register one hotkey: a chord such as 'Mod+S', a sequence such as ['G', 'G'], or an app hotkey. Getters track changing hotkeys and options.


createHotkeyHint

ts
createHotkeyHint: (hotkey, options?) => AlpineHotkeyState<boolean>;

Defined in: types.ts:143

Read whether held modifiers reveal a hotkey through .value.

Parameters

hotkey

MaybeGetter< | RegisterableHotkey | AppHotkey<string, HotkeyChord | HotkeySequence | null>>

options?

MaybeGetter<HeldModifierOptions>

Returns

AlpineHotkeyState<boolean>


createHotkeyRecorder

ts
createHotkeyRecorder: AlpineCreateHotkeyRecorder;

Defined in: types.ts:150

Create a recorder whose options can follow Alpine state.


createHotkeyRegistrations

ts
createHotkeyRegistrations: () => HotkeyRegistrationsResult;

Defined in: types.ts:148

Read live registrations, including disabled entries.

Returns

HotkeyRegistrationsResult


createHotkeys

ts
createHotkeys: (definitions, options?) => void;

Defined in: types.ts:132

Reconcile a list of hotkeys. Definition options override common options.

Parameters

definitions

MaybeGetter<readonly AlpineHotkeyDefinition[]>

options?

MaybeGetter<AlpineHotkeyCommonOptions>

Returns

void


createKeyHold

ts
createKeyHold: (key) => AlpineHotkeyState<boolean>;

Defined in: types.ts:141

Read whether a key is held through .value.

Parameters

key

MaybeGetter<IndividualKey>

Returns

AlpineHotkeyState<boolean>


destroy

ts
destroy: () => void;

Defined in: types.ts:160

Release every registration, subscription, effect, and recorder. Idempotent.

Returns

void