react-hover-action-delay

0.1.1 • Public • Published

react-hover-action-delay

React component to do action on hover after delay.

Installation

With npm :

npm install react-hover-action-delay

With yarn :

yarn add react-hover-action-delay

Usage

<HoverComponent
    timer={2000}
    action={yourAction}
    onMouseLeave={onMouseLeave}
    onMouseEnter={onMouseEnter}
>
    <button>click</button>
</HoverComponent>

with :

  • timer = time in ms (required)

  • action = function to call when timer ended (required)

  • onMouseEnter = function to call on mouse enter on the component

  • onMouseLeave = function to call on mouse leave the component

Package Sidebar

Install

npm i react-hover-action-delay

Weekly Downloads

24

Version

0.1.1

License

ISC

Unpacked Size

9.31 kB

Total Files

6

Last publish

Collaborators

  • son-of-winter