react-scrolled-in

Detect if an element is scrolled into view. Window or container scrolling. Just a render prop.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
react-scrolled-in
221.0.44 years ago5 years agoMinified + gzip package size for react-scrolled-in in KB

Readme

react-scrolled-in Build Status
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