cnippet/ui
  1. motion
  2. text animations
  3. letter swap hover

text animations

Letter Swap Hover

Each letter slides out vertically on hover while an identical copy slides in behind it — creating a smooth looping swap effect driven entirely by cursor entry.

Installation

Usage

Anatomy

Good to know

  • The text goes in the label prop, not in children.
  • The effect plays on hover, so there's nothing to see on touch screens.
  • reverse (default true) sets the roll direction. staggerFrom sets which letter starts.
  • Screen readers get the text through aria-label; the animated letters are hidden from them.
  • When the user has turned on reduced motion, hovering does nothing and the text stays still.

Props

Examples

Each nav link swaps independently on hover. The stagger makes the motion feel distinct per item even when items sit close together.

CTA Buttons

Two buttons — filled and outlined — both using LetterSwapHover. reverse={false} on the primary flips the direction for visual contrast.

Stats Row

Labels beneath stat figures use staggerFrom="center" so letters fan outward from the middle — a subtle touch that differentiates them from standard hover states.