Components

Reveal

Holds its children back until they scroll into view, then draws them on: a wipe along the line, wet ink drying, a sheet dropped on the desk, a stamp, a toss. Direct children can arrive one after another. Without script, and with reduced motion, everything is simply there.

Install

terminal
npx shadcn@latest add @wobko/reveal

First time here? Add the registry to components.json first. How to install

Examples

Default

The heading is drawn on left to right as it comes into view, once, with a marker tip writing it (nib). Replay mounts it again; on a long page it waits until you scroll to it.

Five arrivals

wipe, soak, drop, pop and toss, each one of the theme's keyframes. They play when they are on screen; scroll away and back with once turned off.

A list that arrives line by line

A real use: stagger makes direct children arrive one after another, each drying like wet ink. A group-data variant lets a tick inside key on the reveal.

API reference

Reveal

A wrapper element. It arms itself after mounting (the server sends everything visible), hides its content with opacity, and plays one of the theme's own keyframes when an IntersectionObserver says enough of it is on screen. It leaves data-state="hidden|visible" on itself, so anything drawn inside can key on it with group-data-[state=visible]/reveal:…

PropTypeDefaultDescription
effect"wipe" | "soak" | "drop" | "pop" | "toss""wipe"wipe draws it on along the line (ll-wipe), soak dries it like wet ink (ll-soak), drop lays a sheet down (ll-drop), pop stamps it (ll-pop), toss throws it in (ll-toss).
from"start" | "end""start"Which end a wipe starts from. The wipe follows the page direction by itself.
delaynumber0Seconds to wait once it is in view.
staggernumber-Seconds between direct children (the first 16): they arrive one after another instead of as one block.
thresholdnumber0.25How much of it must be on screen, 0 to 1.
oncebooleantruePlay once, or every time it scrolls back into view.
onReveal() => void-Called each time it is revealed.
nib / nibColorboolean / PaintKeyfalse / "tomato"A hand-drawn marker tip rides the leading edge of a wipe, as if it were writing the content (wipe without stagger only; a list, `as="ul"` or `"ol"`, has nowhere to put the tip and ignores it). The content is wrapped in one block (a span on a p or a span).
as"div" | "section" | "article" | "aside" | "figure" | "ul" | "ol" | "li" | "span" | "p""div"The element to render.

Accessibility

  • Hiding is opacity only: the content stays in the accessibility tree and in the tab order the whole time, so it is never withheld from assistive technology or from find-in-page.
  • The server sends the content visible and unarmed; only after mounting (and only if motion is allowed and IntersectionObserver exists) does it hide and wait. Without script, in old browsers, and with reduced motion (the OS setting, data-motion="reduced" or an InkProvider with motion="reduced") nothing is ever hidden.
  • Each effect uses one of the theme's --ll-dur-* tokens, so a reduced-motion context collapses the duration to zero.
  • Do not wrap content people need at once (above the fold, error messages, focus targets). It is for things that arrive with a flourish as you read down a page.

Source

The files the CLI copies into your project.

Loading the source