# greena13/react-hotkeys

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/greena13-react-hotkeys).**

2,158 stars · 160 forks · JavaScript · ISC

## Links

- GitHub: https://github.com/greena13/react-hotkeys
- Homepage: https://github.com/greena13/react-hotkeys
- awesome-repositories: https://awesome-repositories.com/repository/greena13-react-hotkeys.md

## Description

React hotkeys is a keyboard shortcut manager designed for declaring, scoping, and handling keyboard shortcuts and focus areas in React applications. It allows developers to define declarative shortcuts by binding key combinations or sequences to action names and handler functions, enabling components to respond predictably to user input.

The library provides distinct mechanisms for managing how keyboard events interact with the document. It supports scoping hotkeys to specific component subtrees and DOM descendants to match natural browser focus behavior, alongside global key event handling that captures matching combinations anywhere in the document regardless of active focus. It also excludes input elements and editable content from triggering shortcuts by default, with options to customize these rules.

Additional capabilities include runtime recording of user-pressed key combinations for custom shortcut assignments, and retrieval of active key maps and registered actions from mounted components to support help menu and dialog generation.

## Tags

### User Interface & Experience

- [Focus Management](https://awesome-repositories.com/f/user-interface-experience/focus-management.md) — Manages component focus scopes and tracks active DOM elements for keyboard events. ([source](https://github.com/greena13/react-hotkeys#readme))
- [Keyboard Shortcut Managers](https://awesome-repositories.com/f/user-interface-experience/keyboard-shortcut-managers.md) — Provides a keyboard shortcut manager for declaring, scoping, and handling keyboard shortcuts and focus areas in applications.
- [Keyboard Shortcuts](https://awesome-repositories.com/f/user-interface-experience/component-utilities/keyboard-shortcuts.md) — Binds key combinations or sequences to action names and handler functions declaratively. ([source](https://github.com/greena13/react-hotkeys#readme))
- [Component Focus Management](https://awesome-repositories.com/f/user-interface-experience/keyboard-focus-returners/component-focus-management.md) — Scopes hotkeys exclusively to specific component descendants actively in focus within the document tree. ([source](https://github.com/greena13/react-hotkeys/blob/master/README.md))
- [Input Element Wrappers](https://awesome-repositories.com/f/user-interface-experience/component-architectures/html-element-wrappers/input-element-wrappers.md) — Excludes input elements and editable content from triggering shortcuts by default with customization rules. ([source](https://github.com/greena13/react-hotkeys/blob/master))
- [Component-Based UI Libraries](https://awesome-repositories.com/f/user-interface-experience/component-libraries/component-based-ui-libraries.md) — Builds user interfaces from small reusable React components.
- [Application Action Mappings](https://awesome-repositories.com/f/user-interface-experience/interface-element-management/keyed-element-tracking/keyboard-event-listeners/application-action-mappings.md) — Retrieves complete mappings of all currently mounted actions and key sequences to display help menus. ([source](https://github.com/greena13/react-hotkeys#readme))

### Operating Systems & Systems Programming

- [DOM Focus Filtering](https://awesome-repositories.com/f/operating-systems-systems-programming/application-focus-filtering/dom-focus-filtering.md) — Listens for keyboard input only when specific DOM descendants are active and focused. ([source](https://github.com/greena13/react-hotkeys/blob/master))

### Web Development

- [Focus Management Libraries](https://awesome-repositories.com/f/web-development/frontend-development-tools/frontend-frameworks/component-authoring/react-ecosystem/react-libraries/focus-management-libraries.md) — Provides tools for tracking active DOM elements and scoping keyboard events to specific component subtrees.
- [Global Keyboard Event Listeners](https://awesome-repositories.com/f/web-development/global-keyboard-event-listeners.md) — Captures matching key combinations anywhere in the document regardless of active focus. ([source](https://github.com/greena13/react-hotkeys/blob/master))

### Artificial Intelligence & ML

- [Active Binding Inspections](https://awesome-repositories.com/f/artificial-intelligence-ml/model-inspection-tools/runtime-activation-visualizations/active-binding-inspections.md) — Retrieves active mappings and registered actions from mounted components to support help dialog generation. ([source](https://github.com/greena13/react-hotkeys/blob/master))

### Part of an Awesome List

- [Input Event Filtering](https://awesome-repositories.com/f/awesome-lists/devtools/keyboard-input/input-event-filtering.md) — Ignores or forces observation of key events originating from specific sections of the application. ([source](https://github.com/greena13/react-hotkeys#readme))

### Development Tools & Productivity

- [Custom Key Mappings](https://awesome-repositories.com/f/development-tools-productivity/custom-key-mappings.md) — Records user-pressed key combinations dynamically for custom shortcut assignments at runtime. ([source](https://github.com/greena13/react-hotkeys#readme))
- [Global Hotkey Managers](https://awesome-repositories.com/f/development-tools-productivity/global-hotkey-managers.md) — Handles global shortcut events triggered anywhere in the document. ([source](https://github.com/greena13/react-hotkeys/blob/master/README.md))
- [Dynamic Keyboard Help Views](https://awesome-repositories.com/f/development-tools-productivity/help-generators/dynamic-keyboard-help-views.md) — Generates dynamic help menus and dialogs from active key maps and registered component actions.
- [Key Mapping Inspectors](https://awesome-repositories.com/f/development-tools-productivity/key-mapping-inspectors.md) — Inspects currently mounted action key maps and assigned sequences for debugging. ([source](https://github.com/greena13/react-hotkeys/blob/master/README.md))
