
Description
React HotKeys is a React library for declaring keyboard shortcuts and managing focus areas in a React app. You describe your shortcuts as a key map, attach handlers to them with JSX components or a higher-order component, and the library decides which handler runs based on where focus is. It supports global hotkeys as well as keys that only fire inside a focused element, and it can show users a list of the shortcuts that are currently active. Users can also be allowed to change the keys themselves. The library uses Mousetrap-style key syntax and works with React's synthetic keyboard events. It depends only on prop-types and a peer dependency on React. The author notes that the project has been largely unmaintained for more than six months and is looking for new maintainers to work through open issues. Existing users should check the upgrade notes before moving from version 1.…
Highlights
- Declarative JSX and higher-order component APIs
- Global and in-focus hotkeys
- Mousetrap-style key names and combinations
- Lists available hotkeys for the user to see
- Maintainers wanted for an unmaintained project
Ratings & Reviews
No ratings yet
Be the first to rate react-hotkeys.
People also visit

react-keyboard
A declarative library for handling hotkeys and focus within a React application
react-hotkeys FAQ
What is React HotKeys used for?
It adds keyboard shortcuts to a React application, and it manages which shortcut handlers are active depending on which part of the page has focus.
Is the library still maintained?
The project's README says it has been more or less unmaintained for over six months and is looking for new maintainers to address outstanding issues.
Can users customize their shortcuts?
Yes. The library supports letting users set their own keyboard shortcuts at runtime, and it can display the list of active hotkeys.
What does it depend on?
Only prop-types, plus a peer dependency on react.
Can I use it with many shortcuts at once?
Yes. It is optimized for larger applications with many hotkeys active at the same time, and several optimizations can be turned off individually.
Do I need to upgrade from version 1?
The README links to upgrade notes for moving from the 1.x releases, so check those before updating an existing app.
What are the best react-hotkeys alternatives?
Popular alternatives to react-hotkeys include react-keyboard, @TanStack/hotkeys and react-keydown. See all react-hotkeys alternatives




















