Skip to content
R

react-on-screen

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

by sniphpetFree

#1107in UI Libraries
0In stores

Description

react-on-screen is a small React wrapper component that reports whether its children are visible on the screen. It watches the viewport and…

Highlights

  • Detects when a React component is in view
  • Simple wrapper or render prop usage
  • Track visibility once, then stop listening
  • Offset and partial visibility options
  • Installed from npm, UMD build available

Ratings & Reviews

No ratings yet

Be the first to rate react-on-screen.

People also visit

R

react-visibility-sensor

Sensor component for React that notifies you

UI Libraries
Launch
R

react-lazy-load

Simple lazy loading component built with react

UI Libraries
Launch
R

react-waypoint

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

UI Libraries
Launch
R

react-lazy-load-image-component

React Component to lazy load images using a HOC to track window scroll position

UI Libraries
Launch
R

react-lazyload

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

UI Libraries
Launch
R

react-scroll-trigger

React component tied to scroll events

UI Libraries
Launch

react-on-screen FAQ

What does react-on-screen do?

It is a React wrapper that tells you whether the component inside it is visible in the viewport.

How do I install it?

Install it from npm. The README also lists a UMD build for use without a bundler.

Can it help lazy load images?

Yes. The README suggests using the offset option to start loading an image shortly before it scrolls into view.

Can a component count as visible when only part of it shows?

Yes. Set the partialVisibility prop to count the component as visible as soon as any part of it is on screen.

Can I use a different HTML element as the wrapper?

Yes. The tag prop sets the element used as the wrapper, and it defaults to a div.

What are the best react-on-screen alternatives?

Popular alternatives to react-on-screen include react-visibility-sensor, react-lazy-load and react-waypoint. See all react-on-screen alternatives

Developer Stuff

Badges