Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-hover-zindex

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-hover-zindex

A handy hover tool for React

  • 1.3.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

Join the chat at https://gitter.im/cht8687/react-hover

React Hover --- Turn anything to a 'hoverable' object

Circle CI NPM Version Coverage Status Build Status Downloads Dependency Status License License

React hover

Installation

npm

$ npm install --save react-hover

Demo

Demo

Example code

Code Example

Usage

You can turn plain HTML or your custom trigger/hover components in React-hover.

Below is the example of custom components:

<ReactHover
  options={optionsCursorTrueWithMargin}>
  <ReactHover.Trigger type='trigger'>
    <TriggerComponent />
  </ReactHover.Trigger>
  <ReactHover.Hover type='hover'>
    <HoverComponent />
  </ReactHover.Hover>
</ReactHover>

Or plain HTML element:

<ReactHover
  options={optionsCursorTrueWithMargin}>
  <ReactHover.Trigger type='trigger'>
    <h1 style={{background: '#abbcf1', width: '200px'}}> Hover on me </h1>
  </ReactHover.Trigger>
  <ReactHover.Hover type='hover'>
    <h1> I am hover HTML </h1>
  </ReactHover.Hover>
</ReactHover>

Options

options: PropTypes.object.isRequired

Set the options.


const options = {
  followCursor:true,
  shiftX: 20,
  shiftY: 0
}

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.


<ReactHover.Trigger type='trigger'>
<ReactHover.Hover type='hover'>

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/

License

MIT

Keywords

FAQs

Package last updated on 13 Nov 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc