greena13

greena13/react-hotkeys

Declarative hotkey and focus area management for React

JavaScript
2166
159
ISC License

from a particular area of your app when it is in focus, you can use the `<ObserveKeys/>` component: ```javascript import { ObserveKeys } from "react-hotkeys"; import React from 'react'; <ObserveKeys> /** * Children that, when in focus, should have its key events observed by * react hotkeys */ </ObserveKeys>; ``` ### ObserveKeys component API By default, `<ObserveKeys />` will observe all key events, but you can customize this behaviour by providing a whitelist or blacklist of events to observe: ```javascript <ObserveKeys /** * The whitelist of keys that keyevents should be observed. i.e. if you place * a key in this list, all events related to it will be observed by react * hotkeys. * * Accepts a string or an array of strings. */ only: { [] } /** * The blacklist of keys that keyevents should be not observed. i.e. * if you place a key in this list, all events related to it will be * still be ignored by react hotkeys */ except: { [] } > /** * Children that, when in focus,

Total donated
Undistributed
Share with your subscribers: