react-scrolled-in
v1.0.4
Published
Detect if an element is scrolled into view. Window or container scrolling. Just a render prop.
Downloads
134
Maintainers
Readme
react-scrolled-in
Detect if an element is scrolled into view. Window or container scrolling. Just a render prop. 4kb.
It just calls a render
prop with a visible
boolean, nothing more.
import ScrolledIn from 'react-scrolled-in'
ReactDOM.render(
<SrolledIn
scrollElement={node => node.parentNode.parentNode}
render={({ visible }) => <p>{visible ? 'In View!' : 'Out of view'}</p>}
/>,
document.body
)
More documentation coming soon...
License
MIT © Andrew Joslin