Skip to content

Gradient Text

A flowing colour gradient inside your type.

LIVE PREVIEWInteract with the component
Just React. No extra dependencies.

Copy the component and its CSS module into your project.

CSS Modules

Usage

Matches your current playground settings.

jsx
import GradientText from "./GradientText";
export default function Example() {
return (
<GradientText
text={"Stay curious."}
colors={[
"#f6b8a4",
"#eee5ff",
"#a99bff",
"#f6b8a4"
]}
duration={6}
angle={110}
animated={true}
/>
);
}

Using Gradient Text

Use colors to define a palette with enough contrast against the page background. angle controls the direction of the colour band.

Set animated to false for a static gradient. The visible text still comes entirely from the text prop.

Props

NameTypeRequiredDefaultDescription
textstringNo""Text to render; font size and weight inherit from the caller.
colorsstring[]No["#f6b8a4","#eee5ff","#a99bff","#f6b8a4"]Gradient colour stops. A single colour renders a solid fill.
durationnumberNo6Animation cycle duration in seconds.
anglenumberNo110Gradient angle in degrees.
animatedbooleanNotrueEnable or disable the moving gradient.
classNamestringNo""Additional CSS classes, merged with the component styles.
styleCSSPropertiesNoundefinedInline styles for caller-defined sizing and visual overrides.

Related components

Reflection Text

Text Effects

Crisp typography meets a soft, fading reflection beneath the baseline.

Morphing Words

Text Effects

Words dissolve through a soft blur while the headline keeps its width.

Dot Matrix Text

Text Effects

Amber pinpoints form a crisp matrix display with a soft travelling pulse.

Scan Text

Text Effects

A warm scanning light brings a dim headline into focus.