johannesklauss/react-hotkeys-hook

React hook for using keyboard shortcuts in components.

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 43 minutes ago
Added to GitGenius on September 19th, 2026
Created on November 29th, 2018
Open Issues & Pull Requests: 47 (+0)
GitHub issues: Enabled
Number of forks: 166
Total Stargazers: 3,506 (+0)
Total Subscribers: 3 (+0)

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 18
New in 7 days: 1
Closed in 7 days: 0
Avg open age: 610 days
Stale 30+ days: 16
Stale 90+ days: 14

Recent activity

Opened in 7 days: 1
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • bug (17)
  • Version 5.x (14)
  • good first issue (8)
  • Needs more info (4)
  • enhancement (2)
  • duplicate (1)
  • help wanted (1)
  • wontfix (1)

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

react-hotkeys-hook is a React hook for binding keyboard shortcuts to components in a declarative way.

The tool solves the problem of managing keyboard interactions in React applications by providing a hook-based API that lets developers attach hotkey handlers directly to components. It works by accepting a key combination string and a callback function, triggering the callback when the specified keys are pressed. The library supports scopes, which allow developers to group hotkeys together and prevent collisions by enabling or disabling entire scope groups through the useHotkeysContext hook. It also offers a focus trap feature that restricts hotkey triggering to when a specific component has focus.

Developers should choose this tool if they need straightforward keyboard shortcut handling without complex state management overhead. It suits applications ranging from simple single-page apps to more complex interfaces where keyboard navigation or command shortcuts enhance user experience. The declarative hook-based approach integrates naturally with modern React patterns and component composition.

The project maintains active development with regular updates and bug fixes. The codebase is written in TypeScript, providing type safety for developers using the library. Documentation is comprehensive, including quick start guides, detailed API documentation, and live interactive examples on the project website.