Gradient Text

Text filled with a gradient that slowly flows through it.

no dependenciesMIT · free
Deep blue sea

Use it for a single word too.

Installation

npx shadcn@latest add https://ombakui.com/r/gradient-text.json

Usage

import { GradientText } from "@/components/gradient-text";

<GradientText className="text-7xl font-bold">Deep blue sea</GradientText>
<GradientText colors={["#f97362", "#fbbf24", "#f472b6"]}>single word</GradientText>

Props

PropTypeDefaultDescription
children*ReactNode–
asElementType"span"HTML tag to render.
colorsstring[]ocean bluesGradient colors. The first one is repeated at the end for a seamless loop.
durationnumber6000Milliseconds for one full loop.
anglenumber90Gradient angle in degrees.
classNamestring–