text animations
Breathing Text
Characters pulse between two variable font settings — weight, width, or any axis — in a continuous wave that repeats forever. Requires a variable font.
Installation
Usage
Variable font required —
BreathingTextanimatesfont-variation-settings. The effect is only visible when the active font supports the axes used (e.g.wght,wdth). Inter Variable, Geist, and most Google Fonts variable fonts work out of the box.
Anatomy
Good to know
- It needs a variable font that supports the axes you animate, such as
wghtorwdth. With a normal font nothing moves. childrenmust be plain text. It's split into letters.- This uses a CSS animation, not Motion, so it works without the
motionpackage. - Screen readers read the full text once; the individual letters are hidden from them.
- When the user has turned on reduced motion, the letters stay still at
fromFontVariationSettings.
Props
Examples
Weight + Width Wave
Both wght and wdth axes breathe left-to-right. The characters cycle from thin/condensed to black/expanded.
Center Pulse
A short logotype word pulses outward from the center using staggerFrom="center". Works well for brand marks or hero splash screens.
Heading + Subtitle Pair
Two BreathingText instances — heading and subtitle — with opposite stagger directions and complementary speeds create a layered breathing composition.