Animation

Gradient Text

Animated multi-stop gradient text. The gradient slides across the text via background-clip: text. Optional border variant wraps the text in a dark pill with the same animated gradient as a border ring. Pure CSS port — no JS animation loop.

Angular adaptation of an effect by David Haz / reactbits.dev.

Import

import { WrGradientText } from 'ngwr/gradient-text';

Playground

Hello, ngwr!
<wr-gradient-text
  [animationSpeed]="8"
  direction="horizontal"
  [yoyo]="true"
  [pauseOnHover]="false"
  [showBorder]="false"
>
  Hello, ngwr!
</wr-gradient-text>

Customize

Speed (s)
8.0 s
Direction
Yoyo
Pause on Hover
Border
Text

API

NameDescriptionTypeDefault
colorsGradient stops (any CSS colours).readonly string[]['#5227FF', '#FF9FFC', '#B497CF']
animationSpeedSeconds per full sweep (or per half if yoyo is on).number8
showBorderWrap the text in a dark pill with the gradient as a border.booleanfalse
directionGradient slide direction.'horizontal' | 'vertical' | 'diagonal''horizontal'
pauseOnHoverPause the animation while hovered.booleanfalse
yoyoBounce back-and-forth instead of restarting.booleantrue