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
childrenmust be a plain string.- A common use is loading or "thinking" text.
durationis the seconds per sweep andspreadsets the width of the light. - It sets its own gray text and highlight colors, with separate dark-mode values. Change them with the
--base-colorand--base-gradient-colorCSS 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.