Command Palette

Search for a command to run...

Docs
Mesh Gradient

Mesh Gradient

Animated mesh gradient background with fluid, organic color blending

Mesh Gradient

Fluid, organic color blending with animated blobs

Installation

Usage

import { MeshGradient } from "@/components/motionx/mesh-gradient";

Basic usage

<div className="h-screen w-full">
  <MeshGradient>
    <h1 className="text-4xl font-bold text-foreground">Your Content</h1>
  </MeshGradient>
</div>

Custom colors

<MeshGradient
  colors={[
    "rgba(251, 146, 60, 0.5)",
    "rgba(244, 63, 94, 0.5)",
    "rgba(168, 85, 247, 0.45)",
    "rgba(56, 189, 248, 0.5)",
  ]}
  speed="slow"
>
  <h1 className="text-foreground text-4xl font-bold">Sunset Mesh</h1>
</MeshGradient>

Interactive mode

Interactive Mode

Move your cursor

Blobs follow your mouse with spring physics

<MeshGradient interactive intensity={0.9}>
  <p className="text-foreground">Blobs follow your cursor</p>
</MeshGradient>

Props

PropTypeDefaultDescription
classNamestringContainer CSS classes
colorsstring[]4 curated vals3–6 CSS color values for the gradient blobs
speed"slow" | "medium" | "fast""medium"Animation speed preset
intensitynumber0.8Blur intensity 0–1 (higher = softer blending)
interactivebooleanfalseEnable mouse-following parallax on blobs
childrenReactNodeContent rendered on top of the gradient
styleCSSPropertiesAdditional inline styles on the container

Tip: For the best visual result, use 4–5 colors with moderate alpha (0.4–0.6). Too many fully opaque blobs can muddy the blending.