Scroll Reveal Image
A scroll scrubbed image sequence that lets the next frame arrive in a centered window before it takes over the backdrop. The result feels like a cinematic reveal without scroll hijacking.
Installation#
pnpm dlx shadcn@latest add @davinciui/scroll-reveal-imageUsage#
API Reference#
| Prop | Type | Default |
|---|---|---|
imagesImages shown in scroll order. Each item can provide a wide backdrop source, a portrait reveal source, and alt text. | readonly ScrollRevealImageItem[] | — |
sectionHeightHeight of the scroll runway that drives the sequence. | string | "300vh" |
imageWidthCSS width of the centered reveal window. | string | "clamp(15rem, 30vw, 38rem)" |
imageHeightCSS height of the centered reveal window. | string | "clamp(22rem, 78vh, 52rem)" |
borderRadiusCSS radius applied to the reveal window. | string | "0rem" |
backgroundScaleScale applied to the full-bleed backdrop for a quiet parallax depth effect. | number | 1.08 |
imageScaleScale applied inside the centered reveal window. | number | 1.04 |
scrubSpring mass controlling how closely the motion follows the scroll position. | number | 0.18 |
classNameAdditional classes applied to the scroll section. | string | — |
Accessibility#
The section has an aria-label, but each animated reveal layer is aria-hidden, so its alt text is not announced; only the reduced-motion fallback exposes the final image alt. The effect is scroll-only with no keyboard controls.
Motion#
Scroll progress, smoothed by useSpring, drives clip-path reveals of each image; scrub sets spring mass while backgroundScale and imageScale are static transforms. useReducedMotion renders only the last image as a static section.
View source
Keep in mind
Need a custom component?
I build bespoke UI components & websites tailored to your brand.

