text animations
Text Gradient
An animated gradient flows continuously through text using background-clip. Fully customisable colour stops, angle, and speed.
Installation
Usage
Anatomy
Good to know
childrenmust be a plain string.- Repeat the first color at the end of
colorsfor a seamless loop. anglesets the gradient direction in degrees.durationis the seconds per loop.- Check contrast: some parts of the gradient may be hard to read on your background.
- When the user has turned on reduced motion, the gradient stays still.
Props
Examples
Hero Heading
A violet-to-cyan gradient sweeps across a large heading. Supply colours that repeat at start and end to ensure a seamless loop.
Inline Word Accent
A single word inside a static heading uses TextGradient as a <span>, warming the key term with a fast orange-to-green sweep.
Pricing Cards
Each pricing tier gets its own gradient palette at a slightly different speed, making the prices feel distinct without extra markup.