# keypress-react

> React wrapper for Keypress.js

Latest version **1.0.0** (published 2020-12-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install keypress-react
pnpm add keypress-react
yarn add keypress-react
bun add keypress-react
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2020-12-13 |
| First published | 2020-12-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=10 |
| Dependencies | 0 |
| Unpacked size | 14.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Govind N Sharma |
| Maintainers | gnsharma |

## Links

- npm: https://www.npmjs.com/package/keypress-react
- Repository: https://github.com/gnsharma/react-keypress
- Homepage: https://github.com/gnsharma/react-keypress#readme
- Issues: https://github.com/gnsharma/react-keypress/issues
- npm.io page: https://npm.io/package/keypress-react

## Recent versions

- 1.0.0 (latest) — 2020-12-13

## README

# keypress-react

> React wrapper for Keypress.js

  This library is a react wrapper around the excellent Keypress.js https://dmauro.github.io/Keypress/.

[![NPM](https://img.shields.io/npm/v/keypress-react.svg)](https://www.npmjs.com/package/keypress-react) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

## Install

```bash
npm install --save keypress-react
```

## Usage

  This library has 3 public components.

1. `KeyboardShortcutsProvider` is the Context Provider Component

         import { KeyboardShortcutsProvider } from 'keypress-react'

    This should be at the top of the component tree for which you want to enable shortcuts. It passes the keyboard shortcut context down to your app. All the keyboard shortcut are store in this context.
      
  2. `KeyboardShortcut` is the Shortcut Component

         import { KeyboardShortcut } from 'keypress-react'

       This component take the props `combo`  along with the `callback` and the `description`. 

         <KeyboardShortcuts combo="shift a" callback={callback} description="Example Shortcut" />

  3. `withKeyboardShortcuts` is the HOC Component

         import { withKeyboardShortcuts } from 'keypress-react'

      This is a higher order components. This will inject a prop `keyboardShortcuts` into the provided component. This props contains all the keyboard shortcuts. It is an array of objects with value and description keys.
    
          withKeyboardShortcuts(Component)

  


## License

MIT © [Govind N Sharma](https://github.com/Govind N Sharma)

---
_Source: https://npm.io/package/keypress-react · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
