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

text animations

Text Shimmer

A gradient highlight sweeps continuously across text from right to left, creating a polished metallic shimmer effect using CSS background-clip.

Installation

Usage

Anatomy

Good to know

  • children must be a plain string.
  • A common use is loading or "thinking" text. duration is the seconds per sweep and spread sets the width of the light.
  • It sets its own gray text and highlight colors, with separate dark-mode values. Change them with the --base-color and --base-gradient-color CSS variables.
  • When the user has turned on reduced motion, the shimmer stays still.

Props

Examples

Hero Headline

A large heading with a slow shimmer pass (duration={2.5}). Pairs well with dark backgrounds where the light sweep reads clearly.

Status Badges

Two inline badges use TextShimmer to convey live system state — "operational" and "processing". The shimmer loop keeps the badge feeling active without any blinking.

Feature List

A section heading and three feature strings each shimmer at slightly different speeds, creating a layered depth without additional motion logic.