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 StarsType-safe strings
validated modifiers and keys
Cross-platform
Mod maps to Cmd or Ctrl
Context-aware
scopes, inputs, cleanup, conflicts
useHotkey("Mod+K", runCommand, { enabled: isPanelOpen })
Why Hotkeys
Great shortcuts need platform-aware labels, scoped behavior, input safety, conflict avoidance, sequences, recording, and help surfaces. Hotkeys gives those mechanics a typed home.
Define combinations with a type-safe Hotkey string so invalid modifiers and keys get caught before users do.
Use one shortcut definition while macOS gets Cmd and other platforms get Ctrl without hand-written platform checks.
Support Vim-style sequences, multi-step commands, key hold detection, and contextual command flows.
Let users capture and customize shortcuts with recorder utilities instead of building keyboard parsing from scratch.
Write a type-safe shortcut string with platform-aware modifiers.
Attach it globally, to a document, or to a specific element/ref.
Avoid accidental firing in text inputs or conflicting UI regions.
Run the command, track key state, record input, or render help text.
Shortcut lifecycle
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
Use the core shortcut model across UI runtimes, then wire it into the framework adapter and command surface your product needs.
Open source ecosystem
Maintainers, adapters, examples, partners, and GitHub sponsors keep the shortcut system grounded in real command-heavy interfaces.