React Hover
A hover tool to turn anything ( HTML or React Component) into hover component.
Installation
npm
$ npm install --save react-hover
Example code
Usage
You can turn plain HTML or your custom trigger/hover components in React-hover.
Below is the example of custom components:
Or plain HTML element:
Options
options
: PropTypes.object.isRequired
Set the options.
followCursor
: define if hover object follow mouse cursor
shiftX
: left-right shift the hover object to the mouse cursor
shiftY
: up-down shift the hover object to the mouse cursor
type
type
: PropTypes.string
Set the type.
This prop defines the type name. It must be declared as above if you minify your code in production.
Development
$ git clone git@github.com:cht8687/react-hover.git
$ cd react-hover
$ npm install
$ npm run dev
Then
open http://localhost:8080/webpack-dev-server/