Description
react-visibility-sensor is a React component that tells you when an element goes into or out of the visible part of the browser window. You wrap the content you want to watch, and the sensor calls your callback when that content enters or leaves the viewport, which is useful for lazy loading images, starting an animation when it comes into view, or tracking what a visitor has seen. The README includes install instructions for npm, a way to include the script directly for projects that use bower or a plain script tag, where React and ReactDOM must already be loaded, an example and a props section. The project was sponsored by X-Team, and the repository is on GitHub. It suits React developers who need scroll-based behaviour without writing their own intersection logic. Newer projects may prefer the browser's built-in intersection observer, but this component offers a simple React wrapper around the same idea.…
Highlights
- Detects entering and leaving the viewport
- Wraps any content
- npm or direct script include
- Example and props documented
Ratings & Reviews
No ratings yet
Be the first to rate react-visibility-sensor.
People also visit

react-on-screen
A wrapper component to track if your react component is visible on screen

react-waypoint
A React component to execute a function whenever you scroll to an element

react-lazyload
Lazyload your Component, Image or anything else where the performance matters

react-lazy-load-image-component
React Component to lazy load images using a HOC to track window scroll position
react-visibility-sensor FAQ
What does react-visibility-sensor do?
It tells you when wrapped content goes into or out of the browser's visible area.
What is it used for?
Lazy loading, starting animations on view, and tracking what has been seen.
How do I install it?
With npm, or by including the script directly if you use bower or a plain script tag.
Is there a newer option?
The browser's intersection observer does a similar job, which newer projects may prefer.
What are the best react-visibility-sensor alternatives?
Popular alternatives to react-visibility-sensor include react-on-screen, react-lazy-load and react-waypoint. See all react-visibility-sensor alternatives















