text animations
Variable Font Hover
Each letter's font variation axes — weight, slant, width — animate independently on hover with a configurable stagger, giving text a fluid, character-level morphing feel.
Installation
Usage
Variable font required. This component animates
font-variation-settings— your project must load a variable font that supports the axes you specify (e.g. Inter Variable forwghtandslnt).
Anatomy
Good to know
- The text goes in the
labelprop, not inchildren. - It needs a variable font that supports the axes you animate. With a normal font nothing changes.
- The effect plays on hover, so there's nothing to see on touch screens.
- Screen readers get the text through
aria-label; the animated letters are hidden from them. - When the user has turned on reduced motion, hovering switches the font settings instantly, with no stagger.
Props
Examples
Navigation Links
Nav links bold from the center outward on hover. staggerFrom="center" creates a symmetric wave that feels more natural for short words.
Hero Headline
Two headline lines with inverted settings — the first goes thin-to-bold while the second goes bold-to-thin, creating contrast as you hover between them.
CTA Links
Three call-to-action links each use a different staggerFrom origin — first, center, and last — so each line feels distinct despite sharing the same component.