# Particle Field

> Drifting points that join into a loose network.

Points drift and link up when they pass close, then part around the pointer. For networks, infrastructure and anything about connection.

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

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

<section className="relative overflow-hidden">
  <ParticleField />
  <h1 className="relative">Everything connects</h1>
</section>
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `density` | `number` | `9` | Particles per 100,000 square px (capped at 220). |
| `link` | `number` | `110` | Join distance in px; 0 draws no lines. |
| `speed` | `number` | `14` | Drift in px per second. |
| `repel` | `boolean` | `true` | The pointer pushes particles aside. |
| `opacity` | `number` | `0.6` | Dot and line strength, 0 to 1. |
| `color` | `string` | `"--gxui-ink"` | CSS colour or --gxui-* name. |
| `className` | `string` | — | Extra classes for the outer element. |

## Variants

- **Network.** Points joined by fading lines.
- **Dust.** `link={0}` leaves only drifting points.

## Accessibility

- Decorative only and aria-hidden; never takes pointer events (it listens on the parent).
- Pointer push is off on touch.

## Motion

- One canvas; the particle count is capped so large screens stay smooth.
- Pauses offscreen.
- Reduced motion: the network holds still.
