crucıble

Cleave

Masked line, word, or character reveal that draws text clear of hiding as it scrolls into view, each segment trailing a soft white edge glow along its baseline.

gsapfree

Installation

CLI

npx shadcn@latest add @crucible/cleave

Manual — install dependencies, then copy the source

npm install gsap @gsap/react

Props

PropTypeDefaultDescription
childrenstringThe text to reveal.
by"line" | "word" | "char""line"Split granularity. "line" groups words by measured wrapped line.
as"div" | "p" | "h1" | "h2" | "h3" | "span""div"Element tag rendered for the wrapper.
delaynumberSeconds before the reveal starts.
staggernumberSeconds between each segment's reveal, tail to head.
durationnumberSeconds each segment takes to slide clear of its mask.
scrubbooleanfalseTie progress directly to scroll position instead of a one-shot trigger.
startstringScrollTrigger start, relative to the wrapper entering the scroller's viewport.
endstringScrollTrigger end (only used when scrub is true).
repeatbooleanRe-run every time the element re-enters the viewport (non-scrub only).
scrollerstring | Element | React.RefObject<HTMLElement | null>the window. Pass a ref or element to drive the reveal from an internal overflow-y-auto container insteadThe element ScrollTrigger measures scroll progress against.
glowColorstringsoft whiteColor of the edge-glow that rides each segment's leading baseline.
Also accepts all props of Omit<React.ComponentPropsWithoutRef<"div">, "children">they pass through to the underlying element.

Honors prefers-reduced-motion with a designed static fallback, and passes className through.