UniqueUI

Scroll Reveal

Elements animate into view when they enter the viewport, with 6 animation presets.

npx uniqueui add scroll-reveal

Preview

fade-up

Scroll to reveal

scale

Scroll to reveal

blur

Scroll to reveal

Usage

import { ScrollReveal, ScrollRevealGroup } from "@/components/ui/scroll-reveal";

export default function Example() {
  return (
    <div className="p-10 text-white">
      <ScrollRevealGroup
        animation="fade-up"
        staggerDelay={0.15}
        className="grid grid-cols-1 md:grid-cols-3 gap-4"
      >
        {["fade-up", "scale", "blur"].map((preset) => (
          <div
            key={preset}
            className="p-6 rounded-lg bg-neutral-900/50 border border-neutral-800 text-center"
          >
            <div className="text-lg font-semibold mb-1 text-neutral-200">{preset}</div>
            <p className="text-neutral-500 text-xs">Scroll to reveal</p>
          </div>
        ))}
      </ScrollRevealGroup>
    </div>
  );
}

Props

PropTypeDescription
childrenReact.ReactNodeThe DOM elements to animate into view upon scrolling.
classNamestringStyling classes mapping to the outer tracking viewport.
animationAnimationPresetThe specific animation choreography preset (e.g. 'fade-up', 'scale-in').
delaynumberDelay in seconds before the animation begins.
durationnumberDuration in seconds for the reveal animation.
thresholdnumberIntersection ratio (0-1) required to trigger the reveal.
oncebooleanWhether the element should hide and re-animate when scrolled out and back in.