# Cursor Glow

> A soft light that follows the mouse around a section.

Trails a little behind the pointer and fades when it leaves. Off on touch screens, where there is no hover to follow.

- 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/cursor-glow/
- 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 cursor-glow
```

It installs to `components/galactrex/cursor-glow.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 { CursorGlow } from "@/components/galactrex/cursor-glow";

<section className="relative overflow-hidden">
  <CursorGlow />
  <h1 className="relative">Light follows you</h1>
</section>
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `size` | `number` | `420` | Diameter in px. |
| `intensity` | `number` | `0.16` | Strength at the centre, 0 to 1. |
| `lag` | `number` | `0.5` | How far it trails; 0 sticks to the pointer. |
| `color` | `string` | `var(--gxui-glow)` | Glow colour. |
| `className` | `string` | — | Extra classes for the outer element. |

## Variants

- **Trailing.** Eases after the pointer.
- **Pinned.** `lag={0}` sticks to it.

## Accessibility

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

## Motion

- Spring-follow on transform only.
- Reduced motion: follows without the trailing ease.
