Skip to content

React Mouse Follow to make a react element follow the mouse.

License

Notifications You must be signed in to change notification settings

itsdouges/react-mouse-follow

Repository files navigation

NPM version NPM downloads Build Status codecov Dependency Status

Quick description of what it does!

Installation

npm install react-mouse-follow

Usage

import 'react-mouse-follow/styles.css';
import ReactStickyHeader from 'react-mouse-follow';
import ReactDOM from 'react-dom';

ReactDOM.render(
  <ReactStickyHeader
    // This will be the sticky strip.
    header={
      <div className={cx('Header_root', { sticky })}>
        <h1 className="Header_title">ReactStickyHeader</h1>

        <ul className="Header_links">
          <li className="Header_link">When</li>
          <li className="Header_link">Why</li>
          <li className="Header_link">About</li>
        </ul>
      </div>
    }
  >
    <section>
      // More header stuff here, this won't be sticky.
    </section>
  </ReactStickyHeader>,
  document.getElementById('container')
);
prop type required
children Children no
header Children yes
backgroundImage string no
backgroundColor string no
headerOnly boolean no
onSticky (boolean) => void no
className string no

React Story Book

To run the component in various modes, run the following command then go to http://localhost:6006/.

npm start

Testing

npm test

About

React Mouse Follow to make a react element follow the mouse.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published