The Animated Gradient component creates mesmerizing, high-performance animated backgrounds using WebGL shaders with domain warping for organic, silk-like flowing streams.
Preview
AnimatedGradient
Presets
lava
Installation
$ npx shadcn@latest add https://spark-ui-olive.vercel.app/r/animated-gradient.json
Usage
import { AnimatedGradient } from "@/components/animated-gradient";export default function AnimatedGradientDemo() {
return (
<AnimatedGradient
variant="mist"
speed={0.6}
opacity={0.8}
className="h-96 w-full"
>
<div className="flex flex-col items-center justify-center gap-1.5 w-full h-full select-none pointer-events-none">
<span className="text-4xl sm:text-5xl font-extrabold tracking-tight text-white font-sans drop-shadow-md">
Animated
</span>
<span className="text-xl sm:text-2xl text-zinc-400 font-medium font-serif italic drop-shadow-sm">
Gradient
</span>
</div>
</AnimatedGradient>
);
}Properties
| Prop | Type | Default | Description |
|---|---|---|---|
variant | "mist" | "lava" | mist | Visual effect variant. mist creates a purple/indigo dynamic background, lava creates a rich warm blurry bonfire flow. |
speed | number | 1 | Animation speed multiplier. Higher values = faster animation. |
opacity | number | 0.8 | Canvas opacity (0-1). Use to blend with background layers. |
className | string | — | Additional CSS classes for the container. |
children | ReactNode | — | Overlay content to display on top of the gradient background. |