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

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

  • children must be a plain string.
  • Repeat the first color at the end of colors for a seamless loop.
  • angle sets the gradient direction in degrees. duration is 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.