3.2.5 • Published 6 months ago

react-hotkey-tooltip v3.2.5

Weekly downloads
41
License
MIT
Repository
github
Last release
6 months ago

React Hotkey Tooltip

Master npm version semantic-release Netlify Status

Docs 📚

Why you should use it?

When working with Hotkeys in a React application we will find many problems when trying to implement it:

  • Hotkeys are only accessible inside a specific component (not globally).
  • Must take care of the Hotkeys manually throughout the life cycle.
  • Have to provide a way so the user can see all the Hotkeys on the screen.

This library will help you by declaring global Hotkeys that automatically will be updated by any life cycle of the component and show a tooltip by pressing a combination of keys ✨

Built with

Why mess up with document.addEventListener or positioning/styling Tooltips if there are a lot of open source libraries that can do that for me. These are the chosen ones!

Installation

You can the package manager you want:

# npm
$ npm install react-hotkey-tooltip

# yarn
$ yarn add react-hotkey-tooltip

Example

import React from 'react';
import { Hotkey, HotkeyProvider } from 'react-hotkey-tooltip';

const ClickableButtonByPressingA = () => (
  <HotkeyProvider>
    <Hotkey combination="a" onPress="click">
      <button onClick={() => alert('You have clicked me!')}>
        Click me using your keyboard!
      </button>
    </Hotkey>
  </HotkeyProvider>
);

For more examples please consider checking the Docs section.

License

MIT. Also check react-tippy.js' and mousetrap' license.

3.2.5

6 months ago

3.2.4

1 year ago

3.2.3

1 year ago

3.2.2

2 years ago

3.2.1

2 years ago

3.2.0

2 years ago

3.1.0

3 years ago

2.2.0

4 years ago

3.0.3

6 years ago

3.0.2

6 years ago

3.0.1

6 years ago

3.0.0

6 years ago

2.1.0

6 years ago

2.0.0

6 years ago

1.3.1

6 years ago

1.3.0

6 years ago

0.1.0

6 years ago

0.0.1

6 years ago

0.0.0

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago