TanStack
Hotkeys API Reference

AlpineHotkeys

Defined in: types.ts:67

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

Properties

createHeldKeyCodes

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

Defined in: types.ts:93

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:91

Read held logical key names through .value.

Returns

AlpineHotkeyState<string[]>


createHotkey

ts
createHotkey: (hotkey, callback, options?) => void;

Defined in: types.ts:69

Register one shortcut. Getters track changing bindings and options.

Parameters

hotkey

MaybeGetter<RegisterableHotkey>

callback

HotkeyCallback

options?

MaybeGetter<HotkeyOptions>

Returns

void


createHotkeyHint

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

Defined in: types.ts:97

Read whether held modifiers reveal a binding through .value.

Parameters

hotkey

MaybeGetter<RegisterableHotkey>

options?

MaybeGetter<HeldModifierOptions>

Returns

AlpineHotkeyState<boolean>


createHotkeyRecorder

ts
createHotkeyRecorder: (options) => AlpineHotkeyRecorder;

Defined in: types.ts:104

Create a recorder whose options can follow Alpine state.

Parameters

options

MaybeGetter<HotkeyRecorderOptions>

Returns

AlpineHotkeyRecorder


createHotkeyRegistrations

ts
createHotkeyRegistrations: () => HotkeyRegistrationsResult;

Defined in: types.ts:102

Read live hotkey and sequence registrations, including disabled entries.

Returns

HotkeyRegistrationsResult


createHotkeys

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

Defined in: types.ts:75

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

Parameters

definitions

MaybeGetter<HotkeyDefinition[]>

options?

MaybeGetter<HotkeyOptions>

Returns

void


createHotkeySequence

ts
createHotkeySequence: (sequence, callback, options?) => void;

Defined in: types.ts:80

Register consecutive chords with an optional timeout and element target.

Parameters

sequence

MaybeGetter<HotkeySequence>

callback

HotkeyCallback

options?

MaybeGetter<SequenceOptions>

Returns

void


createHotkeySequenceRecorder

ts
createHotkeySequenceRecorder: (options) => AlpineHotkeySequenceRecorder;

Defined in: types.ts:108

Create a sequence recorder with live steps and explicit commit controls.

Parameters

options

MaybeGetter<HotkeySequenceRecorderOptions>

Returns

AlpineHotkeySequenceRecorder


createHotkeySequences

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

Defined in: types.ts:86

Reconcile a changing list of sequences.

Parameters

definitions

MaybeGetter<HotkeySequenceDefinition[]>

options?

MaybeGetter<SequenceOptions>

Returns

void


createKeyHold

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

Defined in: types.ts:95

Read whether a key is held through .value.

Parameters

key

MaybeGetter<IndividualKey>

Returns

AlpineHotkeyState<boolean>


destroy

ts
destroy: () => void;

Defined in: types.ts:112

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

Returns

void