Zoom Parallax

A turquoise bay ringed by pines and limestone
Concrete spiral staircase shot from below
Turquoise shallows and a pebble beach seen from above
Quiet timber-clad interior
A quiet pebble beach with a wooded headland
A quiet, light-filled interior
Concrete stairwell lit from a single window
About this component

Zoom Parallax

Seven photographs in an asymmetric editorial collage around a center image. As progress runs, every photograph grows from its own place at its own pace, the center fastest, so the center photograph glides to fill the frame while the others fly outward past the edges with real depth. Frames carry soft shadows and the photographs stay crisp all the way in. Progress can come from a number or a live scroll value, or the zoom loops on its own. Layout, depth, shadow, pace and a gentle cursor drift are all props. Reduced motion shows the full center photograph.

Usage

The import and the props worth knowing about, in one place.

import { ZoomParallax } from "@/components/beste/component/zoom-parallax";

<ZoomParallax className="h-[36rem] w-full" />

// Driven by scroll: pass a framer-motion MotionValue (or any { get() }) as progress
const { scrollYProgress } = useScroll({ target: ref });
<ZoomParallax progress={scrollYProgress} autoplay={false} layout="headline" depth={0.8} />

Props

Read from the component's own type, so this cannot drift from what it accepts.

PropTypeDefaultDescription
imagesZoomParallaxImage[]—Up to seven photographs; the first is the center image that grows to fill the frame.
layout"editorial" | "headline"—Collage arrangement: balanced around the center, or with a clear band at the top for a headline.
depthnumber—How much faster the center grows than the photographs around it, 0 to 1.
shadownumber—Soft shadow under each photograph, 0 to 1.
progressnumber | ZoomProgressSource—Zoom from collage (0) to the full center photograph (1): a number or a live source such as a scroll MotionValue.
autoplayboolean—Loop between collage and full frame on its own. Defaults to on when no progress is given.
speednumber—Pace of the autoplay loop.
interactiveboolean—The collage drifts gently with the cursor, the nearest photographs most.
pausedboolean—Freeze the zoom where it is.
classNamestring—
childrenReactNode—Overlay content, positioned by the caller.

More Media components

View all Media

Built around the light.

Curved white bands of a building rising around an opening of blue sky
Snowy peaks under the Milky Way above a dark line of pines
HorizonA mountain valley and lake at first light