# Moving Grid

> A flat grid that slides steadily one way.

Calmer than a perspective floor: a conveyor or scrolling-map feel behind dashboards, docs heroes and empty states.

- 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/moving-grid/
- 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 moving-grid
```

It installs to `components/galactrex/moving-grid.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 { MovingGrid } from "@/components/galactrex/moving-grid";

<section className="relative overflow-hidden">
  <MovingGrid direction="up" />
  <h1 className="relative">Docs</h1>
</section>
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `cell` | `number` | `40` | Cell size in px. |
| `direction` | `"up" \| "down" \| "left" \| "right" \| "diagonal"` | `"diagonal"` | Direction of travel. |
| `speed` | `number` | `3` | Seconds per cell; 0 holds still. |
| `opacity` | `number` | `0.4` | Line opacity, 0 to 1. |
| `fade` | `boolean` | `true` | Fade out toward the edges. |
| `color` | `string` | `var(--gxui-line)` | Line colour. |
| `className` | `string` | — | Extra classes for the outer element. |

## Variants

- **Diagonal.** Drifts down and to the right.
- **Still.** `speed={0}` for a plain grid.

## Accessibility

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

## Motion

- One transform loop per cell.
- Stops offscreen.
- Reduced motion: a still grid.
