Scroll Reveal

Brings content into view as it scrolls onscreen.

Installation

pnpm dlx shadcn@latest add @paneui/scroll-reveal

Usage

Examples

Directions

Stagger

Use for lists and grids so items arrive one after another.

Motion

Under reduced motion it only fades in, over 200 ms.

Uses the container from Smooth Scroll. See also Scroll Progress, Scroll To.

API Reference

ScrollReveal

Fades, slides and unblurs its content in when it enters the nearest contained SmoothScroll or the viewport. Also accepts every prop of motion.div.

from= "bottom"
"bottom" | "top" | "left" | "right"
Edge the content slides in from.
distance= 24
number
Slide distance in px.
blur= 8
number
Starting blur in px.
delay= 0
number
Delay in seconds, for staggering siblings.
once= true
boolean
Reveal once, or every time it re-enters view.
amount= 0.3
"some" | "all" | number
How much must be visible to trigger.
root
RefObject<Element | null>
Scroll root. Defaults to the nearest contained SmoothScroll, then the viewport.
PropTypeDefaultDescription
from"bottom" | "top" | "left" | "right""bottom"Edge the content slides in from.
distancenumber24Slide distance in px.
blurnumber8Starting blur in px.
delaynumber0Delay in seconds, for staggering siblings.
oncebooleantrueReveal once, or every time it re-enters view.
amount"some" | "all" | number0.3How much must be visible to trigger.
rootRefObject<Element | null>—Scroll root. Defaults to the nearest contained SmoothScroll, then the viewport.
data-revealed
Present while the content is in view.
Data attributeDescription
data-revealedPresent while the content is in view.