# Perspective Grid

> A floor of grid lines receding to a horizon.

Depth behind a hero, a launch page or a game menu without competing with the words. Low contrast by default.

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

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

<section className="relative overflow-hidden">
  <PerspectiveGrid />
  <h1 className="relative">Launch week</h1>
</section>
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `cell` | `number` | `48` | Cell size in px. |
| `speed` | `number` | `2.4` | Seconds per cell; 0 holds still. |
| `angle` | `number` | `62` | Tilt of the floor in degrees. |
| `opacity` | `number` | `0.35` | Line opacity, 0 to 1. |
| `horizon` | `number` | `0.35` | Where the floor fades out, from the top. |
| `color` | `string` | `var(--gxui-muted)` | Line colour. |
| `className` | `string` | — | Extra classes for the outer element. |

## Variants

- **Moving.** Glides toward the viewer.
- **Still.** `speed={0}` for a static floor.

## Accessibility

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

## Motion

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