How it works
The text is split into words (CJK into characters, since it has no spaces) and each piece gets its index as a CSS variable. When the element is 30% visible, every piece moves from transparent, blurred and 0.22em low to its place after delay + index × step, with an ease-out. Blur clears a little faster than the fade completes, so the words look as if they come into focus rather than simply appearing. The total spread is capped, so long text still finishes quickly. In character mode each word stays unbreakable, so lines wrap where they would anyway.
Use it for
- Headlines and leads of articles, landing sections and announcements.
- A calm entrance for short text that should be noticed once.
Look elsewhere when
- Body text, lists or anything people need to read at once.
- Text that changes often: every change would replay.
Usage
import { BlurInText } from './BlurInText.jsx'
export function ArticleHeader() {
return (
<>
<BlurInText as="h1" text="The quiet hour before the harbour wakes" stagger={70} />
<BlurInText text="Fishing boats idle at the breakwater." delay={500} stagger={30} blur={6} />
</>
)
}Props
| Prop | Type | Default | What it does |
|---|---|---|---|
text | string | — | The text to reveal. |
as | ElementType | 'p' | Element to render, such as h1. |
by | 'word' | 'char' | 'word' | Pieces to animate. Chinese, Japanese and Korean always go character by character. |
stagger | number | 60 | Delay between pieces in ms. |
maxStagger | number | 1400 | Cap on the total spread, so long text does not take forever. |
duration | number | 700 | Duration of each piece in ms. |
blur | number | 10 | Starting blur in px. |
delay | number | 0 | Delay before the first piece in ms. |
trigger | 'view' | 'mount' | 'view' | Start when visible, or at once. |
onDone | () => void | — | Called when the last piece has settled. |
Accessibility
- The full text sits in a visually hidden span, so screen readers read it once as a sentence; the animated pieces are aria-hidden.
- The rendered element (as) keeps its semantics, such as a heading level.
- Nothing is interactive and no content is withheld: the reveal finishes within about two seconds.
- Reduced motion replaces the blur, movement and stagger with one short fade of the whole text.
Motion
Each piece takes 700ms with an ease-out (blur clears in 80% of that), starting index × 60ms after the delay, with the whole spread capped at 1.4s.
Add it to your project
Copy the prompt into Codex or Claude Code. The agent reads the published source, shows you what it will write and adds the component next to your own.
BlurInText.jsxblur-in-text.csstokens.cssREADME.md
Both files install together. The stylesheet reads the design tokens in tokens.css and carries fallbacks, so it also works alone.



