Reveal

Content arrives as it scrolls into view: rising, wiping open like a mask, or growing. Children arriving together are staggered; ones that scroll in later start fresh. Readable without scripting. Effects.

Open playground

Brief

Define the one moment worth animating.

Block

Lay out the static state first.

Move

Add motion that carries meaning.

Ship

Respect reduced motion, then release.

About

Reveal is a React component in the Effects category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { Reveal } from "@ashutoshswamy/smoui" and set children, effect, direction among its 10 props.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
import { Reveal } from "@ashutoshswamy/smoui";

<Reveal effect="clip" direction="up" stagger={0.08}>
  <Card /><Card /><Card />
</Reveal>

Props 10

children

Each direct child reveals in turn.

ReactNode
effect

Rise travels in, clip wipes open like a mask (crisp, no blur), scale grows from slightly smaller.

"rise""clip""scale"default "rise"
direction

Edge rise comes from, or the way clip wipes.

"up""down""left""right""none"default "up"
stagger

Seconds between children that arrive together. Later arrivals start fresh.

numberdefault 0.08
distance

Travel in px for rise.

numberdefault 24
blur

Start soft and sharpen (rise and scale). Turn off for large blocks.

booleandefault true
delay / maxDelay

Seconds before the first child, and the longest any child waits.

numberdefault 0 / 0.6
amount

Share of a child that must be visible first.

numberdefault 0.25
margin

IntersectionObserver rootMargin. The default waits until a child is a little inside the viewport.

stringdefault "0px 0px -8% 0px"
repeat

Replay on every re-entry.

booleandefault false