willmcpo/body-scroll-lock
Body scroll locking that just works with everything 😏 observed · 2026-08-28
Health v2 · maintenance only
23/100
- Activity 0
- Release rhythm 8
- Longevity 100
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-03. Adoption (stars, forks) is never an input.
- gap_med: n/a
- age_days: 3148
- days_rel: n/a
- days_push: 1252
- n_releases_24m: 0
Adoption not part of the score
4102 stars · 325 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-29, confidence not recorded
A small JavaScript library that locks body scrolling on iOS, Android, and desktop browsers while preserving scrolling of a target element such as a modal, lightbox, or flyout. It works with vanilla JS and frameworks like React, Angular, and Vue.
Use cases
- lock body scroll when a modal is open
- prevent background scrolling on iOS Safari
- keep modal content scrollable while freezing the page
- disable body scroll for lightbox overlays
- lock page scroll behind a mobile nav menu
- handle nested scrollable overlays
- reserve scrollbar width when locking scroll
When to choose
- you need reliable body scroll locking on iOS mobile/tablet
- you want to keep a target element (modal, flyout) scrollable
- you use vanilla JS, React, Angular, or Vue
- you need nested target element support or scrollbar width reservation
When to avoid
- you only target modern browsers with native overflow: clip support and want zero dependencies
- you need a maintained solution - the project is in maintenance with its latest release in 2023
- you need scroll locking for a specific framework with an official built-in solution
Facets
library · maturity maintenance
ui-components middleware web-development frontend mobile-development browser cross-platform body-scroll-lock scroll-locking ios-safari modal lightbox vanilla-js react vue angular nodejs
2 sources
- readme: https://github.com/willmcpo/body-scroll-lock · fetched 2026-08-28 · 7ba2800ab5b0
- registry_npm: https://registry.npmjs.org/body-scroll-lock · fetched 2026-08-29 · 63d674b117ab
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| willmcpo/body-scroll-lock | main | 23 |
For agents
markdown · JSON · MCP: product_card(name="willmcpo/body-scroll-lock")
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem