# Gradient Mesh

> A rolling surface drawn in lines, shaded by depth.

Lines fade from faint at the back to strong at the front, so it reads as depth without colour: terrain, sound, a calm sea. Optional full wireframe.

- 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/gradient-mesh/
- 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 gradient-mesh
```

It installs to `components/galactrex/gradient-mesh.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 { GradientMesh } from "@/components/galactrex/gradient-mesh";

<section className="relative overflow-hidden">
  <GradientMesh />
  <h1 className="relative">Signal</h1>
</section>
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `lines` | `number` | `28` | How many lines make the mesh. |
| `amplitude` | `number` | `26` | Swell height in px. |
| `speed` | `number` | `0.5` | How fast it rolls; 0 holds still. |
| `wireframe` | `boolean` | `false` | Draw the cross lines too. |
| `opacity` | `number` | `0.55` | Nearest-line strength, 0 to 1. |
| `color` | `string` | `"--gxui-ink"` | CSS colour or --gxui-* name. |
| `className` | `string` | — | Extra classes for the outer element. |

## Variants

- **Contours.** Horizontal lines only.
- **Wireframe.** `wireframe` adds the cross lines.

## Accessibility

- Decorative only and aria-hidden; never takes pointer events.

## Motion

- One canvas, drawn once per frame.
- Pauses offscreen.
- Reduced motion: a still surface.
