Loading component…
Loading component…
Letters cut from a liquid, ever-flowing gradient that sweeps in when the text is seen
To reuse this local React demo, copy all files from the Code tab into the same folder, then import GradientText from ./gradient-text.
import { GradientText } from "@/components/ui/gradient-text";
export function Hero() {
return (
<h1>
Interfaces people actually <GradientText>feel.</GradientText>
</h1>
);
}| Name | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | The text to fill with the gradient | |
| colors | string[] | ["#dd0674", "#5e3ee0", "#ff5fae", "#7c5cff"] | Gradient start, end and up to two blob colors; replaces the dark-mode colors too |
| speed | number | 8 | Seconds per flow cycle |
| sweep | boolean | true | Sweep the color in from left to right when the text scrolls into view |
| as | "span" \| "h1" \| "h2" \| "p" | "span" | Element to render |
| className | string | Extra class on the root |
Font, size and weight come from the parent, so it scales with your headline
Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"