Cnippet

Scroll Reveal

Component 11

About

Elements animate into view when they enter the viewport. Supports any Motion variant, configurable thresholds, and a once-only mode.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Scroll Reveal to your project and fits it to your theme.

Code

How Scroll Reveal is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

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

const items = [
  "Pick a component",
  "Run the CLI command",
  "Paste into your project",
  "Customise props & styles",
  "Ship to production",
];

export default function ScrollRevealList() {
  return (
    <div className="flex min-h-50 items-center justify-center px-6">
      <ol className="w-full max-w-xs space-y-2">
        {items.map((item, i) => (
          <ScrollReveal
            as="li"
            key={item}
            transition={{ delay: i * 0.1, duration: 0.45, ease: "easeOut" }}
            variants={{
              hidden: { opacity: 0, x: -20 },
              visible: { opacity: 1, x: 0 },
            }}
            viewOptions={{ amount: 0.5 }}
          >
            <div className="flex items-center gap-3 rounded-lg border border-border bg-card px-4 py-3">
              <span className="flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-primary font-bold text-[10px] text-primary-foreground">
                {i + 1}
              </span>
              <span className="font-medium text-foreground text-sm">
                {item}
              </span>
            </div>
          </ScrollReveal>
        ))}
      </ol>
    </div>
  );
}

Dependencies

More by Cnippet

View all
  • Team

    Team

    1.3K
  • Davincho Hero-1

    Davincho Hero-1

    684
  • Aero Hero-3

    Aero Hero-3

    559
  • Features

    Features

    510
  • Random Letter Swap Navigation

    Random Letter Swap Navigation

    487
  • Services with Animated Hover Modal

    Services with Animated Hover Modal

    465
  • Blogs

    Blogs

    396
  • Aero Hero-1

    Aero Hero-1

    356