Skip to main content
Clever Ops

Reveal Group

A choreography wrapper that gives arbitrary children the library's signature staggered entrance, direction, distance and stagger as props, revealed once and never replayed.

Preview & code

Loading Reveal Group preview

Installation

pnpm dlx shadcn@latest add @cleverui/scroll-reveal-group

Requires the @cleverui registry in your components.json, a one-off, two-line setup.

Usage

tsx
import { ScrollRevealGroup } from '@/components/ui/scroll-reveal-group'
Exampletsx
import { ScrollRevealGroup } from '@/components/ui/scroll-reveal-group'

const CARDS = [
  {
    title: 'Policy-aware match',
    body: 'Tolerance bands and dual-approval thresholds travel with every line, not buried in a shared sheet.',
  },
  {
    title: 'Exception routing',
    body: 'Mismatches escalate to the right owner with source context attached. Resolve before the stand-up starts.',
  },
  {
    title: 'Sealed audit packs',
    body: 'Export a signed pack for any close window: decisions, overrides, and source hashes in one file.',
  },
] as const

export default function ScrollRevealGroupDemo() {
  return (
    <div className="mx-auto max-w-6xl px-4 py-16 sm:px-6 sm:py-24">
      <ScrollRevealGroup direction="up" distance={24} stagger={0.07}>
        <p className="font-mono text-[11px] uppercase tracking-[0.2em] text-muted-foreground sm:text-xs">
          Close operations
        </p>
        <h2 className="mt-4 max-w-xl text-3xl font-semibold tracking-tight text-balance text-foreground sm:text-4xl">
          One sequence. Every entrance inherits the library clock.
        </h2>
        <p className="mt-5 max-w-lg text-base leading-relaxed text-muted-foreground">
          Reveal Group is a transparent choreographer, no chrome of its own.
          Drop real composition in; children rise in reading order with the
          CleverUI motion contract baked in.
        </p>
        <div className="mt-10 grid gap-4 sm:grid-cols-3 sm:gap-5">
          {CARDS.map((card, i) => (
            <div
              key={card.title}
              className="relative overflow-hidden rounded-2xl border border-border/60 bg-card p-6"
            >
              {i === 0 && (
                <span
                  aria-hidden="true"
                  className="absolute inset-y-0 left-0 w-0.5 bg-primary"
                />
              )}
              <h3 className="text-lg font-medium tracking-tight text-card-foreground">
                {card.title}
              </h3>
              <p className="mt-2 text-sm leading-relaxed text-muted-foreground">
                {card.body}
              </p>
            </div>
          ))}
        </div>
      </ScrollRevealGroup>
    </div>
  )
}

API reference

ScrollRevealGroup accepts the following props.

PropTypeDefaultDescription
children*React.ReactNodeelements revealed in DOM order
direction'up' | 'down' | 'left' | 'right' | 'none''up'transform axis for the entrance
distancenumber24travel distance in px
staggernumber0.07seconds between each child
delaynumber0seconds before the first child starts
durationnumber0.5per-child duration in seconds
oncebooleantruefire a single time; scrolling back never replays
classNamestring

Frequently asked questions

How do I install the Reveal Group component?

Register the @cleverui registry in your components.json ("@cleverui": "https://cleverops.com.au/r/{name}.json"), then run `npx shadcn@latest add @cleverui/scroll-reveal-group`. The shadcn CLI copies the source into your project, you own the code from that point. You can also copy the source directly from this page.

What dependencies does Reveal Group require?

Reveal Group uses motion on top of React and Tailwind CSS. You don't need to install it manually, the shadcn CLI resolves and installs npm dependencies automatically when you add the component.

Can I theme Reveal Group to match my brand?

Yes. The component is styled entirely with Tailwind utilities over standard design tokens (primary, background, muted, border), so it inherits your existing shadcn/ui theme automatically. Change your CSS variables and the component follows, no source edits needed for palette, radius, or fonts.

Want this built for you?

CleverUI is built by the Clever Ops web team. If you'd rather ship a hand-coded, fast, custom website than assemble one, we build them for Australian businesses every week.

Explore web development services