Skip to main content
Version: 3.x

Installation

Note: React 16.8+ is required to use Hooks.

Yarn & NPM

To install the package we use our favorite package manager.

yarn add react-hotkeys-hook

ES Module

To use the ES Module we can reference it directly from unpkg.com:

import { useHotkeys } from 'https://unpkg.com/browse/react-hotkeys-hook@3.4.0/dist/react-hotkeys-hook.esm.js';

Direct CommonJS Module

We also have access to a development as well as a minified production bundle for CommonJS:

<script src="https://unpkg.com/browse/react-hotkeys-hook@3.4.0/dist/react-hotkeys-hook.cjs.development.js"/>

Now we are good to go to use the hook.