import { Meta, Props } from '@storybook/addon-docs/blocks'
import KeypressListener from './'

<Meta title="Utilities/Events/KeypressListener" />

# KeypressListener

A KeypressListener is a helper component that automatically handles the binding and unbinding of key events (`keyup`).
KeypressListener is used as a child component, as it's `document` on/off bindings happen automatically as the parent component mounts and unmounts.

## Example

```jsx
<MyComponent>
  <KeypressListener keyCode={Keys.ENTER} handler={surprise} />
  ...
</MyComponent>
```

## Props

<ArgsTable of={KeypressListener} />
