Lerp

Horizontal scroll track

Demo

Vertical scroll moves a gallery sideways without taking over the wheel or touch.

How it works

Scroll· 3 sites

Reference: ResizeObserver, MDN contributors

How it works

Vertical scroll moves a gallery sideways without taking over the wheel or touch.In 5 steps.

Let the wheel keep its direction. A sticky viewport crops a wider strip; the strip travels exactly its overflow width as the section scrolls past. Sunday and Naya provide the library evidence for this pattern; the artwork here is original CSS.

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

    Build a real row

    Use a flex row with fixed-basis cards inside a sticky clipping stage.

  2. 02

    Measure the overflow

    The distance is track.scrollWidth minus the stage width. Recompute when the container resizes, not on every frame.

  3. 03

    Translate only the track

    Map native vertical progress to a negative horizontal transform. Do not cancel wheel or touch events.

  4. 04

    Offer a simpler reading order

    Under reduced motion, remove the runway and stack the cards vertically.

  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

Vertical scroll moves a gallery sideways without taking over the wheel or touch.

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

A single transform moves the track. Keep the strip short on mobile to bound composited-layer memory; do not promote every card. Load images near the viewport and give them explicit dimensions. 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 ResizeObserver 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.