FX · Interactions

Content that fades and slides into place as it scrolls into view.

Reveal
on
scroll
bash
npx shadcn@latest add https://www.rad-ui.com/r/reveal-on-scroll.json
React
import RevealOnScroll from "@/components/fx/reveal-on-scroll" <RevealOnScroll from="below" delay={120}>…</RevealOnScroll>
  • Content is always in the DOM and the accessibility tree; only its opacity and position animate.
  • Keyboard focus landing inside hidden content reveals it immediately.
  • prefers-reduced-motion: reduce (or data-rad-fx-motion="reduce" on an ancestor) shows content from the first paint.
PropTypeDefaultDescription
from
'below' | 'above' | 'left' | 'right' | 'none'
'below'

Where the content comes from.

distance
number
24

Travel in px.

duration
number
700

Milliseconds.

delay
number
0

Milliseconds before starting.