Cómo funciona
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.
Úsalo para
- Headlines and leads of articles, landing sections and announcements.
- A calm entrance for short text that should be noticed once.
Busca otra opción cuando
- Body text, lists or anything people need to read at once.
- Text that changes often: every change would replay.
Uso
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} />
</>
)
}Propiedades
| Propiedad | Tipo | Por defecto | Qué hace |
|---|---|---|---|
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. |
Accesibilidad
- 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.
Movimiento
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.
Añádelo a tu proyecto
Copia la instrucción en Codex o Claude Code. El agente lee el código publicado, te muestra lo que va a escribir y añade el componente junto a los tuyos.
BlurInText.jsxblur-in-text.csstokens.cssREADME.md
Los dos archivos se instalan juntos. La hoja de estilos lee las variables de tokens.css y lleva valores de reserva, así que también funciona sola.



