# Animated Grid

> A fine grid where single cells light up and fade.

A board that looks like it is thinking: behind status pages, dashboards and product heroes. The cell under the pointer answers too.

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

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

<section className="relative overflow-hidden">
  <AnimatedGrid />
  <h1 className="relative">Status</h1>
</section>
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `cell` | `number` | `40` | Cell size in px. |
| `lit` | `number` | `8` | Cells lit at once. |
| `fade` | `number` | `2.4` | Seconds for a cell to glow and fade. |
| `hover` | `boolean` | `true` | Light the cell under the pointer. |
| `opacity` | `number` | `0.5` | Grid line strength, 0 to 1. |
| `color` | `string` | `"--gxui-ink"` | CSS colour or --gxui-* name for lit cells. |
| `className` | `string` | — | Extra classes for the outer element. |

## Variants

- **Thinking.** Random cells glow and fade.
- **Hover only.** `lit={0}` lights only the cell under the pointer.

## Accessibility

- Decorative only and aria-hidden; never takes pointer events (it listens on the parent).

## Motion

- One canvas, drawn once per frame.
- Pauses offscreen.
- Reduced motion: a still grid with a few lit cells.
