blaze-motion
← All components

Text Reveal

Text

Word-by-word text reveal — tokens rise and fade in sequence as the line enters view.

Installation

One command drops the source into your repo — editable, with the provider and motion pulled in automatically.

npx shadcn add https://motion.asmitsah.dev/r/text-reveal.json

Usage

By word (default)

Wrap your own element — its tag + className win. Each word rises + fades 0.04s apart; the string stays one accessible label.

import { TextReveal } from "@/components/motion/text-reveal";

<TextReveal by="word">
  <h2 className="text-2xl font-medium">Reveals word by word.</h2>
</TextReveal>

By char

Finer-grained — good for short headlines or a single emphasized line.

<TextReveal by="char">
  <span className="text-xl font-medium">Letter by letter.</span>
</TextReveal>

Trigger on mount

Play immediately instead of waiting for scroll — for above-the-fold hero text.

<TextReveal trigger="mount">
  <h1 className="text-3xl font-semibold">Above the fold, ready on load.</h1>
</TextReveal>

Custom stagger + delay

Slow the step down and lead with a delay to sequence against a neighboring element.

<TextReveal stagger={0.08} delay={0.2}>
  <p className="text-sm text-muted-foreground">Slower, and led by a beat.</p>
</TextReveal>

Props

PropTypeDefaultDescription
childrenReactElementA single host element (h1–h6/p/span/div) wrapping plain-string text. Its tag, className + style are reused and it carries the aria-label. Required.
by"word" | "char""word"Split granularity — stagger each word, or each character within each word.
trigger"inView" | "mount""inView"Animate on scroll-into-view (once) or immediately on mount.
staggernumber0.04 word / 0.02 charSeconds between each staggered word/char. Overrides the by-based default.
delaynumber0Seconds before the first word/char animates.