Mesh Gradient — React Animated Background
Voronoi-cell color fields flowing through a curated palette — the classic mesh-gradient look, live on the GPU.

Starting live preview
Usage
import { MeshGradient, MESH_GRADIENT_PRESETS } from "@/components/MeshGradient";
export function MeshHero() {
return (
<section style={{ position: "relative", minHeight: "100dvh" }}>
<MeshGradient {...MESH_GRADIENT_PRESETS.aurora}
{...{
interactive: true,
speed: 0.6,
scale: 3.2,
softness: 0.09,
from: "#0b1120",
to: "#155e75",
accent: "#7c3aed",
deep: "#f472b6"
}}
/>
<div style={{ position: "relative", zIndex: 1, padding: "8rem 2rem" }}>
<h1>Color fields, computed live</h1>
</div>
</section>
);
}Implementation notes & API
Purpose: animated mesh-gradient background for product heroes and pricing walls. Mount: full-bleed layer behind content. Props: from/to/accent/deep palette, speed, scale (cell size, lower = larger), softness (edge crispness). Pointer: the color field drifts with the cursor; interactive={false} pins it. Guardrails: four-color palette — keep at least one dark tone for text contrast; WebGPU required with fallback prop.
| Property | Type | Notes / default |
|---|---|---|
interactive | boolean | false in the library; enabled in this preview |
fallback | ReactNode | Shown when the renderer is unavailable |
className / style | string / CSSProperties | Applied to the outer container |
View source on GitHubFree for commercial projects · MIT