A highly accessible, semantic typography engine that supports all standard HTML text tags with advanced, staggered visual effects and deep layout controls.
Building animated text that scales responsively and doesn't break screen readers is tricky. Standard staggered character animations often result in screen readers spelling out words letter-by-letter. This AnimatedTypographyBlock automatically wraps your content in an sr-only tag for assistive technologies, while orchestrating the visual animations on hidden child spans.
It features a Smart Sizing Engine. You can maintain semantic SEO value (like rendering an h1) but visually override the size using either a Tailwind class (3xl) or a hardcoded CSS value (24px, 2rem).
Previews replay every two seconds. Use the reload button in a preview's header to restart one.
What it is.AnimatedTypographyBlock renders text with one of 14 variant animations: matrix-scramble, color-reveal, wavy-float, 3d-perspective-flip, elastic-spring, spotlight-reveal, split-stagger, underline-draw, letter-bounce, typewriter, word-flip, blur-swap, blur-rise and color-wipe. letter-bounce, typewriter, word-flip and blur-swap cycle through a words list.
How it is built. It renders the real tag you choose with as, puts a plain-text copy in an sr-only span, and marks the animated copy aria-hidden. Motion comes from CSS keyframes and a few timers, with no animation library. size sets the visual size separately from the tag, and the base styles keep the text on one line.
When to use it. Use it for hero headlines, rotating value propositions, callouts and section titles where the wording itself should move.
For AI agents
Hand your agent this brief or the Markdown page, not a screenshot.
When to use
Hero headlines, rotating value propositions
Interactive callouts, kinetic section titles
When not to use
Lightweight CSS-only text reveals with no animation library: use Text Animation
Named export AnimatedTypographyBlock from @/components/custom/blocks/AnimatedTypographyBlock. as defaults to "p" and variant to "matrix-scramble".
text is what screen readers announce. For the rotating variants (letter-bounce, typewriter, word-flip, blur-swap) pass the words in words and set text to the first word.
prefixPosition is "fixed" or "fluid". It defaults to "fluid" for typewriter and "fixed" for the others; use "fixed" when the text before the word must stay still.
size takes a Tailwind key such as "3xl" or a CSS length such as "2rem". color takes indigo, rose, emerald, zinc, primary or a hex string; left out, the text uses the foreground color.
delay is in milliseconds and speed multiplies the stagger and animation times. Set play={false} to hold the text at rest until it should start.
The 14 animation patterns applied to the text. letter-bounce, typewriter, word-flip and blur-swap rotate through words.
AnimatedTypographyBlock
words
ReactNode[]
[text]
The words the rotating variants cycle through. Plain strings animate letter by letter; other nodes move whole. text is still what screen readers announce, so set it to the first word.
AnimatedTypographyBlock
interval
number
2400
Milliseconds each word stays on the rotating variants. The typewriter holds a finished word this long instead, 1800 by default.
AnimatedTypographyBlock
prefixPosition
"fixed" | "fluid"
"fluid" for typewriter, "fixed" otherwise
Whether the text before the rotating words holds still. fixed reserves the longest word's width; fluid follows the word on show, so a centred line re-centres as the word types, deletes or swaps.
AnimatedTypographyBlock
index
number
—
Shows words[index] instead of stepping on a timer — for words kept in step with something else, like a carousel's slides. The typewriter keeps its own time.
AnimatedTypographyBlock
children
ReactNode
—
Rich content for blur-rise and color-wipe in place of text, such as a heading with an <em> in it.
AnimatedTypographyBlock
play
boolean
true
false renders the text at rest; the animation starts when it turns true. For reveals that wait on scrolling into view.
AnimatedTypographyBlock
bare
boolean
false
Drops the block's own weight, size, colour, alignment and padding, so className and the parent set the type — for composing it into a section heading.
AnimatedTypographyBlock
titlePrefix / titleSuffix
string
—
Static text either side of the animated part, e.g. titlePrefix="Build " before a rotating word.
AnimatedTypographyBlock
align
"left" | "center" | "right" | "justify"
"left"
Controls the CSS text alignment of the underlying container.
Text colour; "default" is the theme foreground, black in light mode and white in dark. Not applied when bare is set unless you pass it.
AnimatedTypographyBlock
size
string
Per tag
A Tailwind size key such as "3xl" (scaled down on small screens) or a CSS length such as "2rem", which is clamped from 10px up to that value.
AnimatedTypographyBlock
delay
number
0
Base delay in milliseconds before the animation starts.
AnimatedTypographyBlock
speed
number
1
Multiplier for the stagger and animation times. Higher is slower.
Works with other components
Text Animation for scroll-reveal headlines driven by GSAP, when you want text to animate as it enters the viewport.
Circular Text for text set around a rotating ring, such as a badge.
Hover Peek for interactive editorial statements, alongside a heading from AnimatedTypographyBlock.
Does AnimatedTypographyBlock break screen readers?
No. It renders your text once in an sr-only span, including titlePrefix and titleSuffix, and wraps the animated copy in a span with aria-hidden="true". Screen readers therefore hear the sentence, not individual letters. For rotating variants they hear text, so set it to the first word.
How do I keep the titlePrefix from shifting during typewriter animations?
Pass prefixPosition="fixed". The typewriter defaults to "fluid", where the text before the word re-centres as letters are typed and deleted. With "fixed" the block reserves the width of the longest entry in words, so titlePrefix stays where it is for the whole cycle.
How do I rotate through several words with AnimatedTypographyBlock?
Use variant="typewriter", "letter-bounce", "word-flip" or "blur-swap" and pass words, for example words={["Interfaces", "Components"]} with titlePrefix="Build ". Each word stays interval ms (2400 by default, 1800 for the typewriter), or pass index to choose the word yourself.
How do I change the size of AnimatedTypographyBlock without changing the heading tag?
Pass size and keep as="h1". A Tailwind key such as "3xl" maps to a responsive text class, and any other value, such as "2rem" or "24px", becomes a clamped font size that shrinks on small screens. The tag, and so the heading outline, does not change.
How do I start an AnimatedTypographyBlock animation when it scrolls into view?
Control play yourself. While play is false the text renders at rest, and the animation starts the moment it becomes true. Set it from an IntersectionObserver or your own in-view hook, since the block does not watch scrolling on its own.
Does AnimatedTypographyBlock respect reduced motion?
Mostly. A prefers-reduced-motion: reduce rule cuts the CSS animations to near zero duration, and the typewriter types and deletes whole words at once. matrix-scramble runs on a timer, so the media rule does not cover it; pass play={false} for people who prefer less motion.