RE

React Hotkeys

@tanstack/react-hotkeys

React adapter for TanStack Hotkeys

Utilities
react
tanstack
keys
tanstack-intent
@tanstack/react-hotkeys
Utilities
javascript
npm
frontend
open source
Stars
749
Weekly
687k
Open issues
3
Bundle
~25 kB

Installation

npm install @tanstack/react-hotkeys

Code example

import { useHotkeys } from "@tanstack/react-hotkeys";

export function Example() {
  const value = useHotkeys();
  return <p>{String(value)}</p>;
}

Pros & cons

Pros

  • Actively maintained by Tanner Linsley
  • 687k weekly downloads. Battle tested
  • First-class TypeScript definitions
  • MIT licensed

Considerations

  • Adds roughly ~25 kB to your bundle
  • Needs client-only rendering in SSR frameworks
  • Not supported in React Native
  • 3 open issues on GitHub

FAQs

Alternatives & similar libraries