cnippet/ui
  1. motion
  2. text animations
  3. variable font hover

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 for wght and slnt).

Anatomy

Good to know

  • The text goes in the label prop, not in children.
  • 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

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.

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.