FX · Interactions

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

Reveal
on
scroll
Terminal
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
number24

Travel in px.

duration
number700

Milliseconds.

delay
number0

Milliseconds before starting.