# Warp Field

> Stars rushing out of a vanishing point.

Travel at speed: stars stretch into streaks as they near the edges. For launch moments, loading screens and space heroes.

- 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/warp-field/
- 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 warp-field
```

It installs to `components/galactrex/warp-field.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 { WarpField } from "@/components/galactrex/warp-field";

<section className="relative overflow-hidden">
  <WarpField />
  <h1 className="relative">Launching</h1>
</section>
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `stars` | `number` | `260` | How many stars (capped at 800). |
| `speed` | `number` | `1.2` | 1 is a cruise, 4 is a jump. |
| `originX` | `number` | `0.5` | Vanishing point across the width, 0 to 1. |
| `originY` | `number` | `0.5` | Vanishing point down the height, 0 to 1. |
| `opacity` | `number` | `0.8` | Line strength, 0 to 1. |
| `color` | `string` | `"--gxui-ink"` | CSS colour or --gxui-* name. |
| `className` | `string` | — | Extra classes for the outer element. |

## Variants

- **Cruise.** Calm forward travel.
- **Jump.** `speed={4}` for hyperspace.

## Accessibility

- Decorative only and aria-hidden; never takes pointer events.
- High speeds are intense; keep them for short moments.

## Motion

- One canvas, drawn once per frame.
- Pauses offscreen.
- Reduced motion: stars hold still as points.
