1.0.4 ā€¢ Published 5 years ago

react-hotkeyz v1.0.4

Weekly downloads
261
License
MIT
Repository
github
Last release
5 years ago

āŒØ react-hotkeyz

Build Status Coverage Status npm.io npm.io npm.io code style: prettier All Contributors PRs Welcome

A component that enables registration of hotkeys per z-index.

Before:

A broken example

With react-hotkeyz:

A working example

Install

npm install --save react-hotkeyz

Or if you prefer yarn:

yarn add react-hotkeyz

Quick Example:

šŸ¤ž

import { useHotkeys, Hotkeys } from "react-hotkeyz";

More examples on https://react-hotkeyz.netlify.com.

Additional information

  1. Only listeners from current z-index are triggered
  2. Uses is-hotkey lib
  3. Only one key press listener is registered
  4. When there are no active callbacks, event listener is completely removed
  5. When trying to register the same shortcut on the same z-index, an error will be thrown
  6. Can be used as a hook or a HOC

Contributors

Thanks goes to these wonderful people (emoji key):

Adrian SmijuljšŸ’» šŸ“– šŸ’” šŸ‘€ āš ļø

This project follows the all-contributors specification. Contributions of any kind welcome!