Animated Gradient

Animated gradient background with multiple shader effects built using WebGL.

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

PropTypeDefaultDescription
variant"mist" | "lava"mistVisual effect variant. mist creates a purple/indigo dynamic background, lava creates a rich warm blurry bonfire flow.
speednumber1Animation speed multiplier. Higher values = faster animation.
opacitynumber0.8Canvas opacity (0-1). Use to blend with background layers.
classNamestringAdditional CSS classes for the container.
childrenReactNodeOverlay content to display on top of the gradient background.