# scroll-into-view/scroll-into-view-if-needed

Element.scrollIntoView ponyfills for things like "if-needed" and "smooth"

Repository: https://github.com/scroll-into-view/scroll-into-view-if-needed
Canonical: https://ross.abutalabs.com/products/scroll-into-view-if-needed
Homepage: https://scroll-into-view.dev
Language: JavaScript
License: MIT
License Family: permissive
Topics: ponyfill, scrolling, animation, smooth-scrolling, typescript, polyfill, scrollintoview, scroll-into-view, smooth, smoothscroll
Last push: 2026-08-26T18:33:48+00:00

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

## Adoption (not part of the score)
Stars 1450, forks 77 (observed 2026-08-28T04:04:45.878341+00:00)

## What it is
A small, dependency-free JavaScript ponyfill for Element.scrollIntoView that implements upcoming spec features like scrollMode: 'if-needed', behavior: 'smooth', and alignment options. It lets developers scroll elements into view only when necessary, with customizable boundaries and scroll behavior.

## Use cases
- scroll an element into view only if it is not fully visible
- smoothly scroll to a DOM element with consistent behavior across browsers
- align a scrolled element to center of the viewport
- limit scrolling to a specific boundary container
- replace non-standard scrollIntoViewIfNeeded with a spec-compliant API
- customize scroll animation with a custom behavior function

## When to choose
- you need 'if-needed' scrolling semantics in browsers that lack support
- you want consistent smooth scrolling behavior across Chrome, Firefox, and Safari
- you need fine-grained control over scroll alignment and boundaries
- you want a tiny, dependency-free scrolling utility

## When to avoid
- native Element.scrollIntoView already covers your needs in your target browsers
- you need scroll animation outside the DOM/browser context
- you need a full-featured animation library rather than a scrolling utility

## Facets
- artifact type: library
- maturity: stable
- function: animation
- domain: web-development, frontend
- platform: browser, cross-platform
- tags: ponyfill, smooth-scrolling, scrollintoview, typescript, dom

## Member repositories
- scroll-into-view/scroll-into-view-if-needed (main) score 67

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:45.878341+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-30T04:35:57.042782+00:00, confidence not recorded.
  - readme: https://github.com/scroll-into-view/scroll-into-view-if-needed (fetched 2026-08-28T04:04:45.878341+00:00, sha aa2b94802305)
  - homepage: https://scroll-into-view.dev (fetched 2026-08-29T11:45:43.208234+00:00, sha c189c9d38a46)
  - registry_npm: https://registry.npmjs.org/scroll-into-view-if-needed (fetched 2026-08-29T11:45:43.217143+00:00, sha 7161938a4b6b)
- Data as of 2026-08-30T08:39:29.467469+00:00.
