Lerp

Pinned scroll chapters

Demo

A native-scroll stage holds its place while three editorial chapters slide through it.

How it works

Scroll· 11 sites

Reference: CSS positioning, MDN contributors

How it works

A native-scroll stage holds its place while three editorial chapters slide through it.In 5 steps.

A chapter needs room to unfold, not a slower wheel. Pin the stage with CSS sticky, then map the space left in its parent to progress. The page keeps native touch momentum, keyboard scrolling and its scrollbar.

The controls below are authored demonstration values, not measurements of the linked sites. The stored fits currently describe scroll smoothing and intro curves, not this effect's geometry; see each site's spec sheet for those separately measured values and fit errors.

  1. 01

    Reserve the runway

    Make the section taller than its sticky child. The difference is the scroll distance, not a time duration.

  2. 02

    Pin the stage

    Use position: sticky inside the runway, without a transformed ancestor or an accidental overflow parent.

  3. 03

    Map position to progress

    Divide scrollTop by the runway travel and clamp to the unit interval. Translate opaque chapters vertically, reading geometry before writing transforms; text never crossfades over other text.

  4. 04

    Keep the story readable

    The reduced-motion version lays every chapter out in order instead of pinning or hiding it.

  5. 05

    Dispose cleanly

    Call destroy() when the view unmounts to disconnect resize and preference observers, remove scroll listeners and cancel pending frames.

Code

The code

The engine is the file the demo above runs, framework-agnostic; the Svelte and React tabs wire it into a component.

Pro

Copy the engine, React or Svelte version.

Unlock code with Pro

US$60/year or US$8/month. Cancel anytime.

Prompt

Prompt pack

A native-scroll stage holds its place while three editorial chapters slide through it.

1 prompts in Pro Generated 25 Sep 2026

  • Build it with a coding agentA framework-independent implementation brief with authored controls.

Pro opens every prompt, with the measured values filled in and ready to paste into your coding agent.

Unlock prompts with Pro

US$60/year or US$8/month. Cancel anytime.

Performance & accessibility

Performance

Only the three chapter transforms change. Geometry is cached on resize; the frame callback sleeps when scroll stops. Avoid embedding several decoding videos in the same pinned stage. The demo targets a frame budget suitable for phone displays; profile on the target device rather than treating an unloaded desktop frame counter as a guarantee. The host pauses the demo off screen. The standalone engine removes its observers and listeners on destroy.

Reduced motion

Reduced motion gives a readable still or ordinary document flow, without an automatic loop. Live preference changes are respected. The scroll region is keyboard-focusable; touch remains native. Keep essential information outside decorative layers and do not add live announcements for motion.

Source

Source, credited

Original teaching implementation and CSS artwork, informed by the credited CSS positioning documentation and the library's linked site observations. No source site's code or assets are reproduced. A site link describes the observed visual pattern, not proof that the site uses this engine or browser API.

Seen in the library

Sites using this effect.