Quick description of what it does!
npm install react-mouse-follow
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 |
To run the component in various modes, run the following command then go to http://localhost:6006/
.
npm start
npm test