Skip to content

ajoslin/react-scrolled-in

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published