Power-User Systems

Parallax Rail

A pinned section where scrolling down drives content sideways across depth planes moving at different rates.

Install

bun add motion clsx tailwind-merge

Then copy 2 files into your project:

  • components/registry/parallax-rail/parallax-rail.tsx
  • lib/utils.ts

Props

PropTypeDefaultDescription
planesnumber3How many depth planes to render.
travelnumber1Multiplier on the front rail's travel across the pin.
depthSpreadnumber0.45How much slower the backmost plane moves than the front.
dampingnumber30Spring damping on the scrub — higher tracks scroll exactly.
fadeEdgesnumber0.12Width of the soft mask at each rail edge.
railGapnumber24Vertical gap between planes.

What It Demonstrates

Parallax
Background and foreground move at different speeds while scrolling, creating depth.
Scroll-driven animation
An animation whose progress is tied directly to scroll position.
Translate
Move an element along the X or Y axis.
Orchestration
Deliberately timing multiple animations so they feel like one coordinated motion.
Mask
Hiding or revealing parts of an element using a shape or gradient — like clip-path, but with soft, fadeable edges.
Compositing
Letting the GPU move or fade an element on its own layer without redoing layout or paint.

Related Components

Appears In