Skip to content
TanStack

Hotkeys

beta

Great defaults for everyone. Superpowers for your power users.

Type-safe keyboard shortcuts for any framework. They stay out of the way while people type, show the right keys on every platform, and let users pick their own.

Docs
launch board

What a keydown listener misses

A keydown listener takes five minutes. Then someone types in a text box, or opens your app on Windows, or uses a German keyboard.

  • j in a textarea

    Text fields

    Pressing J in a comment box types a J. It doesn't jump to the next item.

  • ⌘S

    Browser defaults

    ⌘S saves your doc, not the web page.

  • Mod+S

    macOS, Windows, and Linux

    Write Mod once. Mac users get ⌘, everyone else gets Ctrl.

  • G then I

    Sequences

    G then I for the inbox. The Konami code, if you're feeling it.

  • ⌘K twice

    Conflicts

    Two features grab the same key? You decide who wins.

  • unmount

    Cleanup

    Shortcuts go away with the component that added them.

  • ⌥S → "ß"

    Keyboard layouts

    German, French, Russian, Dvorak. Your shortcuts still work.

  • IME

    Input methods

    People typing Japanese or Chinese won't trigger shortcuts by accident.

Typed shortcut strings

Your editor autocompletes every shortcut. Typos and impossible combos fail before you ship them.

Editor.tsx

useHotkeys([

{ hotkey: 'Mod+Alt+K

Mod+Alt+K

Mod+Alt+KanaMode

Mod+Alt+Katakana

Mod+Alt+[KanaMode]

Mod+Alt+[Katakana]

Mod+Alt+[KeyA]

{ hotkey: 'Mod+Control+S' },

Type error: Type '"Mod+Control+S"' is not assignable to type 'RegisterableHotkey'. Did you mean '"Control+S"'?

])

Labels for each platform

Mac users see ⌥⇧⌘S. Windows users see Ctrl+Alt+Shift+S. Same shortcut, and nobody has to translate.

formatForDisplay

Hints while a modifier is held

Hold ⌘ or ⌥ and the buttons show their shortcuts. People learn them without opening a help page.

discoverable

Shortcuts users can change

List your shortcuts once and get a cheat sheet and a settings page out of it. Users press the keys they want, and Hotkeys tells them when something else already has them.

shortcut settings

Awesome Devtools

See every registered shortcut and watch what fires as you press keys. Much better than console.log.

Partners

Gold
Render
Netlify
Lovable
CodeRabbit
Cloudflare
Railway
Vercel
Silver
Clerk
AG Grid
WorkOS
OpenRouter
SerpApi
Bronze
Unkey
Scarf
Sentry
Prisma
OSS Sponsors

Sponsors get special perks like private discord channels, priority issue requests, and direct support!