Gradient Mesh
Generative mesh gradient background using overlapping radial gradients.
pnpm dlx @glinui/cli@latest add gradient-meshAnswers from your data, without the SQL
Connect a warehouse, ask in plain language and pin the result to a dashboard your whole team can open.
Works with
- Vercel
- GitHub
- Cloudflare
- Astro
Installation$
pnpm dlx @glinui/cli@latest add gradient-meshPrefer the package?
Usage$
Place GradientMesh inside a relative container. It renders overlapping blurred radial gradients that shift position via CSS animations.
Examples$
Variants$
import { GradientMesh } from "@glinui/ui"
export function Variants() { return ( <div data-glin-theme="dark" className="grid w-full gap-3 sm:grid-cols-3"> <div className="relative isolate flex h-44 items-end overflow-hidden rounded-xl bg-[var(--surface-0)] p-3"> <GradientMesh intensity={0.6} /> <span className="relative z-10 rounded-full bg-black/70 px-2.5 py-1 text-xs font-medium text-white">Default</span> </div> <div className="relative isolate flex h-44 items-end overflow-hidden rounded-xl bg-[var(--surface-0)] p-3"> <GradientMesh colors={["#f43f5e", "#f97316", "#eab308"]} intensity={0.5} /> <span className="relative z-10 rounded-full bg-black/70 px-2.5 py-1 text-xs font-medium text-white">Warm</span> </div> <div className="relative isolate flex h-44 items-end overflow-hidden rounded-xl bg-[var(--surface-0)] p-3"> <GradientMesh duration={24} blur={120} intensity={0.5} /> <span className="relative z-10 rounded-full bg-black/70 px-2.5 py-1 text-xs font-medium text-white">Slow and soft</span> </div> </div> )}Behind a sign in card$
import { GradientMesh, Button, Heading, Input, Label, Text } from "@glinui/ui"
export function SignIn() { return ( <section data-glin-theme="dark" className="relative isolate flex min-h-[26rem] w-full items-center justify-center overflow-hidden rounded-xl bg-[var(--surface-0)] px-4 py-10"> <GradientMesh intensity={0.5} /> <form className="relative z-10 flex w-full max-w-sm flex-col gap-4 rounded-2xl border border-[var(--line-soft)] bg-[var(--surface-1)] p-6 text-left [box-shadow:var(--shadow-lg)]"> <div className="flex flex-col gap-1"> <Heading level={2} size="sm">Sign in to Northwind</Heading> <Text size="sm" variant="muted">Use your work email to continue.</Text> </div> <div className="flex flex-col gap-1.5"> <Label htmlFor="email">Work email</Label> <Input id="email" type="email" autoComplete="email" placeholder="you@company.com" /> </div> <div className="flex flex-col gap-1.5"> <Label htmlFor="password">Password</Label> <Input id="password" type="password" autoComplete="current-password" placeholder="At least 12 characters" /> </div> <Button type="submit" className="w-full">Continue</Button> </form> </section> )}Accessibility$
- Renders with
aria-hidden, invisible to assistive technologies. - Purely decorative; carries no semantic meaning.
Reduced Motion$
Mesh animations are paused via motion-reduce:[animation:none]. Static gradients remain visible.
API Reference$
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
blur | number | No | 60 | Blur intensity in px |
colors | string[] | No | ["var(--color-accent)", "var(--tone-danger)", "var(--tone-info)", "var(--gradient-to)"] | Gradient color stops. Defaults come from theme tokens. |
duration | number | No | 10 | Animation duration in seconds |
intensity | number | No | 0.6 | Overall intensity/opacity (0-1) |
Source$
import { GradientMesh } from "@glinui/ui"Generated API Snapshot
Beta
Generated API Snapshot
BetaAuto-extracted from TypeScript source in packages/ui/src/components/gradient-mesh.tsx. This section is in beta and may lag behind hand-curated docs. Regenerate with pnpm --filter @glinui/docs api:generate.
Generated: 2026-10-08T01:41:21.546Z · Full index: /docs/api-metadata
Primary Props Type
GradientMeshProps
GradientMeshProps
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
blur | number | No | 60 | Blur intensity in px |
colors | string[] | No | ["var(--color-accent)", "var(--tone-danger)", "var(--tone-info)", "var(--gradient-to)"] | Gradient color stops. Defaults come from theme tokens. |
duration | number | No | 10 | Animation duration in seconds |
intensity | number | No | 0.6 | Overall intensity/opacity (0-1) |