Skip to content
English
Text reveal comes with Pro. Its preview shows once you unlock it.

How it works

Text is first split into words and spaces, using Intl.Segmenter when available. Punctuation joins a neighbouring word so it never starts a line. In character mode, each CJK character is a group and each Latin word is one non-breaking group animated letter by letter. Pieces are inline-block with one --i variable and the delay is a CSS calc. The animation uses backwards fill, so no filter remains.

Use it for

  • Headlines and hero text on landing pages.
  • Short statements that should be read one beat at a time.
  • Text that should appear only when it scrolls into view (trigger="inView").

Look elsewhere when

  • Long paragraphs: the reveal takes too long and slows reading.
  • Text people must read at once, such as errors and prices.
  • Content that updates often: every change would replay the animation.

Usage

import { TextReveal } from './TextReveal.jsx'

export function Hero() {
  return (
    <>
      <TextReveal as="h1" text="Make every moment count" split="char" stagger={40} />
      <TextReveal as="p" text="Plan, track and share your days" split="word" delay={300} trigger="inView" />
    </>
  )
}

Props

PropTypeDefaultWhat it does
textstring—The text to show. It may contain line breaks (\n).
as'h1' | 'h2' | 'h3' | 'h4' | 'p' | 'span' | 'div''p'Tag to render.
split'char' | 'word''char'How to split: by character or by word (Chinese is grouped into words, falling back to characters without Intl.Segmenter).
staggernumber40Interval between neighbouring pieces, in ms.
durationnumber560Reveal time of each piece, in ms.
delaynumber0Delay before the whole reveal starts, in ms.
blurbooleantrueWhether to include a 6px to 0 blur.
distancenumber | string'0.35em'Rise distance; numbers are px.
trigger'mount' | 'inView''mount'Play on mount, or when scrolled into view (only once).
replayKeyKey—Changing it plays the reveal again.
localestring'zh-CN'Language used to split words. It does not change the text.
onComplete() => void—Called when the last piece finishes revealing.
...restHTMLAttributes<HTMLElement>—Other attributes go to the root element, such as className, style and id.

Accessibility

  • Screen readers read one complete hidden copy of the text; all split pieces are aria-hidden.
  • The hidden copy cannot be selected, so copying text does not produce it twice.
  • Reduced motion shows the text at once, and onComplete is still called.
  • Waiting pieces stay hidden instead of flashing before they play.
  • Keep contrast and size as for any text; the effect never changes the final look.

Motion

Each piece takes 560ms ease-out (cubic-bezier(0.16, 1, 0.3, 1)), 40ms apart; it rises 0.35em and un-blurs from 6px to 0.

Add it to your project

Pro members copy a prompt and their coding agent installs the source, the same way as the free components.

TextReveal.jsxtext-reveal.csstokens.cssREADME.md

Both files install together. The stylesheet reads the design tokens in tokens.css and carries fallbacks, so it also works alone.

Text motion
Morphing text comes with Pro. Its preview shows once you unlock it.