asafefe.dev

Gradient Text

Text with an animated flowing gradient. Bring your own colors and speed.

utils
Ship faster

Installation

$ pnpm dlx shadcn@latest add @soultel/gradient-text

No namespace set up? npx shadcn@latest add https://asafefe.dev/r/gradient-text.json works too.

Manual installation
  1. 1. Copy the source from the Code tab into components/gradient-text.tsx.
  2. 2. Add the keyframes it uses (gradient-flow) to your global CSS. The CLI does this for you.

Usage

example.tsx5 lines
import { GradientText } from "@/components/gradient-text"

export function Example() {
  return <GradientText className="text-3xl font-bold">Ship faster</GradientText>
}

Props

PropTypeDefaultDescription
colorsstring[]-Gradient stops. Repeat the first at the end for a seamless loop.
speednumber6Seconds per sweep.