Text Animations

Redact

Copy that arrives fully classified under solid bars, then declassifies word by word — each bar clearing its own word and leaving an amethyst edge behind as the only evidence it was ever there.

Install

bun add clsx tailwind-merge

Then copy 2 files into your project:

  • components/registry/redact/redact.tsx
  • lib/utils.ts

Props

PropTypeDefaultDescription
mode"wipe" | "slide" | "lift""wipe"How a bar leaves. Wipe retracts it into its own edge, slide throws it clear of the word, lift peels it off the page — wipe reads as redaction being undone, slide reads as tape being pulled.
direction"ltr" | "rtl" | "center-out" | "random""ltr"The order words declassify in. Random is the only one that reads as a machine working through a document rather than a person reading it.
durationnumber420How long one bar takes to clear its own word.
staggernumber70Gap between one word starting to clear and the next. At 0 the whole block lifts at once and the espionage goes out of it.
startDelaynumber300Dead air after the classified block lands before the first bar moves. The pause is what makes the reveal feel authorised.
barPaddingnumber3How far each bar overhangs its word. Drawn tight to the glyphs it reads as a highlighter; give it a couple of pixels and it reads as tape laid over the page.
loopbooleanfalseBring the bars back down and run the whole sweep again, forever, instead of settling on plain text.
intervalnumber3.5Seconds the plain text stays legible before the bars come back down.
barColorstring (hex)"#15101f"Solid ink of the bars. Near-black on purpose — a censor bar that lets any of the word through is not a censor bar.
edgeColorstring (hex)"#a855f7"Amethyst hairline riding the retreating edge of each bar. It is the only part of the effect the eye actually tracks.

What It Demonstrates

Reveal
Content is uncovered gradually, often by animating a clip-path or mask.
Mask
Hiding or revealing parts of an element using a shape or gradient — like clip-path, but with soft, fadeable edges.
Clip-path
Clipping an element to a shape, used for reveals, masks, and before/after sliders.
Stagger
Animate several items one after another with a small delay between each, creating a cascade.
Enter / Exit
The animation an element plays when it's added to or removed from the screen.
Ease-out
Starts fast, ends slow. The default for most UI and anything responding to the user.
Loop
An animation that repeats, a set number of times or infinitely.

Related Components

Appears In