# joshwnj/react-visibility-sensor

Sensor component for React that notifies you when it goes in or out of the window viewport.

Repository: https://github.com/joshwnj/react-visibility-sensor
Canonical: https://ross.abutalabs.com/products/react-visibility-sensor
Language: JavaScript
License: MIT
License Family: permissive
Last push: 2024-04-24T19:31:59+00:00

## Health v2 (maintenance only)
Score: 32/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 4376, "days_push": 861, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2320, forks 194 (observed 2026-08-28T04:06:37.105188+00:00)

## What it is
A React component library that detects when its wrapped element enters or leaves the browser viewport and fires an onChange callback. It supports partial visibility, pixel offsets, and interval-based checks.

## Use cases
- trigger animations when a component scrolls into view
- lazy-load images when they become visible
- track how long content is visible to users
- pause videos when scrolled out of the viewport
- fire analytics events on element visibility
- detect partial visibility of elements during scrolling

## When to choose
- you need viewport visibility detection in a React app with fine-grained control over offsets and partial visibility
- you need to support older browsers or React versions where IntersectionObserver-based hooks are not viable

## When to avoid
- you are using a modern stack where the native IntersectionObserver API or a hook like react-intersection-observer suffices
- your project is not React-based
- you need visibility detection outside the browser (e.g., server-side or native apps)

## Facets
- artifact type: library
- maturity: maintenance
- function: ui-components, state-management
- domain: frontend, web-development
- platform: browser
- tags: react, viewport-detection, scroll-events, lazy-loading, visibility-sensor, nodejs

## Member repositories
- joshwnj/react-visibility-sensor (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:37.105188+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:38:49.391597+00:00, confidence not recorded.
  - readme: https://github.com/joshwnj/react-visibility-sensor (fetched 2026-08-28T04:06:37.105188+00:00, sha 110c387388ef)
  - registry_npm: https://registry.npmjs.org/react-visibility-sensor (fetched 2026-08-29T10:19:09.074018+00:00, sha bee76a7ad6bb)
- Data as of 2026-08-30T08:39:29.467469+00:00.
