Hotkeys Docs
Getting Started
AI/LLM: This documentation page is available in plain markdown format at/hotkeys/latest/docs/installation.md
Installation
Install the adapter for your framework with your preferred package manager:
shell
npm i @tanstack/react-hotkeysshell
pnpm add @tanstack/react-hotkeysshell
yarn add @tanstack/react-hotkeysshell
bun add @tanstack/react-hotkeysEvery framework adapter re-exports the core @tanstack/hotkeys package, so you don't need to install both.
Note
Not using a framework? Install @tanstack/hotkeys directly for vanilla JavaScript or TypeScript.
Requires React 18 or newer. useHotkey is a client hook and HotkeysProvider is a client component, so server components like Next.js app/layout.tsx can render HotkeysProvider directly. To pass appHotkeys from a Server Component, use AppHotkeysProvider instead. See App hotkeys with Server Components.
Start with the React Quick Start. To add the devtools panel, install:
shell
npm i @tanstack/react-devtools
npm i @tanstack/react-hotkeys-devtoolsshell
pnpm add @tanstack/react-devtools
pnpm add @tanstack/react-hotkeys-devtoolsshell
yarn add @tanstack/react-devtools
yarn add @tanstack/react-hotkeys-devtoolsshell
bun add @tanstack/react-devtools
bun add @tanstack/react-hotkeys-devtoolsSee Devtools for setup instructions.