MeshGradient
The Neon brand-deck gradient as a live WebGL surface.
MeshGradient recreates the Neon brand-deck gradient as a shader: a defocused color field on warm near-black — deep moss in one corner, burnt ember through the middle, gold pinned top-right, and a bright yellow-green bloom left of center. Each region drifts on its own slow orbit, a gentle noise warp keeps the edges organic, and a fine dither keeps the soft falloffs from banding. Use it behind heroes, covers, and marketing moments. Drag the dials — warp loosens the blob edges, glow runs the bloom hotter, and the palettes re-tint the whole field:
Install
npx shadcn@latest add https://ui.neon.com/r/mesh-gradient.json
Usage
import { MeshGradient } from "@/components/neon-ui/mesh-gradient";
<section className="relative isolate overflow-hidden bg-black">
<MeshGradient className="absolute inset-0" />
<div className="relative">{content}</div>
</section>;
Props
speed?number
Animation speed multiplier; 0 freezes the field.
number0.6warp?number
0-1 domain warp — how organic the blob edges get.
number0.4grain?number
0-1 dither strength; keeps soft falloffs from banding.
number0.5glow?number
Brightness multiplier on the bloom blob.
number1colors?MeshGradientPalette
The field, painted back to front: [base, moss, ember, gold, bloom].
MeshGradientPalette["#0b0b08", "#2c4a33", "#a85f1b", "#edbf4e", "#eef2a0"]Palettes
The typed fixtures ship three: brand (the deck gradient), neon (the green family), and dusk (indigo through pink). Any five CSS colors work — the geometry never changes, so palettes stay swappable.
Accessibility
- The canvas is
aria-hiddendecoration; content stacks above it in the DOM. - Renders one static frame under
prefers-reduced-motion(and whenspeedis 0). - Foreground text needs its own contrast against the field — add a scrim overlay (the demo shows a bottom
bg-gradient-to-t from-black/70layer). The source slide’s dark bottom band is exactly such a scrim, deliberately not baked into the gradient. - Skips GL work entirely while the canvas is hidden, so it costs nothing behind overlays.