# JohannesKlauss/react-hotkeys-hook

React hook for using keyboard shortcuts in components.

Repository: https://github.com/JohannesKlauss/react-hotkeys-hook
Canonical: https://ross.abutalabs.com/products/react-hotkeys-hook
Homepage: https://react-hotkeys-hook.vercel.app/
Language: TypeScript
License: MIT
License Family: permissive
Topics: react, hooks, hook, react-hooks, javascript, typescript, hotkeys, hotkey
Last push: 2026-08-26T00:31:07+00:00

## Health v2 (maintenance only)
Score: 96/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 90, longevity 100
- inputs: {"age_days": 2834, "days_push": 8, "days_rel": 68, "gap_med": 26.0, "n_releases_24m": 13}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 3511, forks 167 (observed 2026-08-28T04:08:07.713846+00:00)

## What it is
A small, dependency-free React hook (useHotkeys) for declaratively binding keyboard shortcuts in components. It supports modifier combinations, key sequences, scopes, focus traps, and custom user-recorded hotkeys with first-class TypeScript types.

## Use cases
- add keyboard shortcuts to a react component
- implement a ctrl+k command palette in react
- bind vim-style key sequences in a web app
- enable shortcuts only when a modal or editor is focused
- let users record their own custom hotkeys
- group and toggle hotkeys with scopes to avoid conflicts

## When to choose
- you use React and want declarative, per-component keyboard shortcuts
- you need scopes, sequences, or focus-trapped hotkeys without heavy setup
- you want a tiny (~3KB) zero-dependency, well-typed library

## When to avoid
- you're not using React (use a framework-agnostic hotkey library)
- you need global OS-level or Electron app shortcuts rather than in-browser keys
- you need a full shortcut-management UI or complex keymap serialization out of the box

## Facets
- artifact type: library
- maturity: active
- function: ui-components, developer-tools
- domain: frontend, web-development, developer-tools
- platform: browser, cross-platform
- tags: react, react-hooks, keyboard-shortcuts, hotkeys, typescript, keybindings, nodejs

## Member repositories
- JohannesKlauss/react-hotkeys-hook (main) score 96

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:07.713846+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:35:42.806615+00:00, confidence not recorded.
  - readme: https://github.com/JohannesKlauss/react-hotkeys-hook (fetched 2026-08-28T04:08:07.713846+00:00, sha 16e7be4a9c3c)
  - homepage: https://react-hotkeys-hook.vercel.app/ (fetched 2026-08-29T09:29:48.244286+00:00, sha b1b8e4c0847d)
- Data as of 2026-08-30T08:39:29.467469+00:00.
