# Mesh Gradient

> Soft colour fields that melt together and wander.

Light through frosted glass: four blurred fields on slow loops. Quiet in theme tones; vivid with a brand palette.

- Family: Backgrounds
- Plan: Creative. Included with Creative.
- Requires: React, Tailwind CSS v4 and the motion package
- Page with a live preview: https://galactrex.com/ui/mesh-gradient/
- Licence: https://galactrex.com/ui/license/

## Install

```sh
npx @galactrex/ui login   # once, with an API key from https://galactrex.com/account/
npx @galactrex/ui add mesh-gradient
```

It installs to `components/galactrex/mesh-gradient.tsx`, with the shared motion helpers beside it. First time in a project: `npx @galactrex/ui init` (setup guide: https://galactrex.com/docs/ui-components-setup/).

## Usage

```tsx
import { MeshGradient } from "@/components/galactrex/mesh-gradient";

<section className="relative overflow-hidden">
  <MeshGradient colors={["var(--gxui-glow)", "var(--gxui-accent)"]} />
  <h1 className="relative">Studio</h1>
</section>
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `colors` | `string[]` | — | Up to four CSS colours; defaults to theme tones. |
| `speed` | `number` | `22` | Seconds for the slowest loop; 0 holds still. |
| `blur` | `number` | `70` | Blend softness in px. |
| `opacity` | `number` | `0.45` | Strength, 0 to 1. |
| `className` | `string` | — | Extra classes for the outer element. |

## Variants

- **Theme.** Quiet monochrome fields.
- **Brand.** Pass `colors` for a colour mesh.

## Accessibility

- Decorative only and aria-hidden; never takes pointer events.
- Check text contrast when passing bright colours.

## Motion

- Transform-only loops under one blur.
- Still offscreen.
- Reduced motion: still fields.
