Text Animations
Redact
Copy that arrives fully classified under solid bars, then declassifies word by word. Each bar clears its own word and leaves an amethyst edge behind as the only evidence it was ever there.
Install
bun add clsx tailwind-mergeThen copy 2 files into your project:
- components/registry/redact/redact.tsx
- lib/utils.ts
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| 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. |
| duration | number | 420 | How long one bar takes to clear its own word. |
| stagger | number | 70 | Gap between one word starting to clear and the next. At 0 the whole block lifts at once and the espionage goes out of it. |
| startDelay | number | 300 | Dead air after the classified block lands before the first bar moves. The pause is what makes the reveal feel authorised. |
| barPadding | number | 3 | How 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. |
| loop | boolean | false | Bring the bars back down and run the whole sweep again, forever, instead of settling on plain text. |
| interval | number | 3.5 | Seconds the plain text stays legible before the bars come back down. |
| barColor | string (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. |
| edgeColor | string (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
Inlay
A live shader material poured into real letterforms — molten rock, aurora, chrome, embers, tide. The text stays a real text node at transparent, so it is still selectable, searchable and read aloud exactly once while something genuinely animated fills it.
Reel
A sentence with one slot that keeps changing. The words sit on a drum. The next word rolls up from below while the old one rolls away over the top, as a whole word or letter by letter. The slot's width springs to fit each new word, so the rest of the sentence is pushed along and does not jump. A screen reader gets every word once, as a list.
Letters Pull
A per-letter pull-up reveal. Letters rise, sharpen from a blur, and fade in with a stagger.
Split Flap
A Solari departure board. Every column walks the charset one flap at a time until it reaches its letter, so the word is never revealed. It is arrived at, with a real hinged half falling away as the next one seats behind it.
Reflow
Text whose words keep their identity when the line breaks move. Narrow the measure and the sentence travels instead of re-wrapping.
Metallic Text
Chrome poured into a headline. A metal ramp clipped to real glyphs, a specular travelling across them, and a tinted wake following a beat behind.