A simple React sticky component
Wrap any code within and pass css styles
<Sticky>
<h1>Now I'm sticky</h1>
</Sticky>
and it will be sticky
.stickyStyle {
backgroundColor: '#FFF',
top: '0'
}
<Sticky className="stickyStyle">
This is a React component!
</Sticky>
.stickyStyle {
backgroundColor: '#FFF',
bottom: '0'
}
<Sticky className="stickyStyle">
This is a React component!
</Sticky>
<Sticky
className={style}
scrollIndex={100}
stickyWidth="100%"
>
</Sticky>
- className - Any CSS styles needed to pass down to child components
- scrollIndex - @scrollIndex y=100 the stickyness will apply to the wrapped component
- stickyWidth - Takes width if passed or defaults to 100%
- zIndex - Takes a custom zIndex or its set to max