TanStack Hotkeys
Type-safe keyboard interactions
Keyboard shortcuts that know where they are allowed to fire.
Hotkeys gives apps type-safe shortcut strings, cross-platform Mod handling, scopes, sequences, recording, key state tracking, and framework adapters for serious keyboard interaction systems.
00.0 MillionTotal Downloads000,000,000Weekly Downloads0GitHub Stars
Type-safe strings
validated modifiers and keys
Cross-platform
Mod maps to Cmd or Ctrl
Context-aware
scopes, inputs, cleanup, conflicts
Why Hotkeys
Keyboard UX is product logic, not an event listener.
Great shortcuts need platform-aware labels, scoped behavior, input safety, conflict avoidance, sequences, recording, and help surfaces. Hotkeys gives those mechanics a typed home.
Shortcut strings are part of the type system.
Define combinations with a type-safe Hotkey string so invalid modifiers and keys get caught before users do.
Mod means the right thing on each platform.
Use one shortcut definition while macOS gets Cmd and other platforms get Ctrl without hand-written platform checks.
Sequences and holds unlock richer UI.
Support Vim-style sequences, multi-step commands, key hold detection, and contextual command flows.
Recording belongs in the product.
Let users capture and customize shortcuts with recorder utilities instead of building keyboard parsing from scratch.
1
Define
Write a type-safe shortcut string with platform-aware modifiers.
2
Scope
Attach it globally, to a document, or to a specific element/ref.
3
Filter
Avoid accidental firing in text inputs or conflicting UI regions.
4
Handle
Run the command, track key state, record input, or render help text.
Shortcut lifecycle
Define, scope, filter, handle.
Hotkeys keeps the full lifecycle explicit so shortcuts feel fast without surprising people while they type, edit, or work inside a focused panel.
Framework adapters
One keyboard core, product-specific command systems.
Use the core shortcut model across UI runtimes, then wire it into the framework adapter and command surface your product needs.
ReactPreactSolidSvelteVueAngular
Open source ecosystem
Hotkeys is for apps where keyboard UX is part of the product.
Maintainers, adapters, examples, partners, and GitHub sponsors keep the shortcut system grounded in real command-heavy interfaces.
Partners
Hotkeys You?
We're looking for
TanStack Hotkeys
Partners to join our mission! Partner with us to push the boundaries of
TanStack Hotkeys
and build amazing things together.
Only one thing left to do...
