cnippet/ui
  1. motion
  2. text animations
  3. breathing text

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 — BreathingText animates font-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 wght or wdth. With a normal font nothing moves.
  • children must be plain text. It's split into letters.
  • This uses a CSS animation, not Motion, so it works without the motion package.
  • 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.