# Cursor Glow

A dithered spotlight that follows the pointer.

Source: https://gradients.sh/docs/pro/cursor-glow

## Installation

```bash
npx gradients.sh add cursor-glow
```

Pro: this needs a Pro account. The first run on a computer prints a login link for the user to approve, then you run it again. Details: https://gradients.sh/docs/pro.md.

## Usage

```tsx
import { CursorGlow } from "@/components/cursor-glow";

<CursorGlow className="h-[560px]">{children}</CursorGlow>;
```

It fills its box, so give it a height. Children render on top.

## Props

| Prop                 | Type                                 | Default             | Description                                                                                                                               |
| -------------------- | ------------------------------------ | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `palette`            | `"ultramarine" \| "ember" \| "mono"` | `"ultramarine"`     | A curated ramp that follows light and dark mode. Ignored when `colors` is set.                                                            |
| `colors`             | `string[]`                           | none                | 2 to 6 CSS colours from the faintest light to the hottest, `var(--x)` included.                                                           |
| `background`         | `string`                             | `var(--background)` | The surface outside the light.                                                                                                            |
| `follow`             | `number`                             | `1`                 | 0 to 1. How closely the light follows the pointer; 0 leaves it drifting at rest.                                                          |
| `softness`           | `number`                             | `0.45`              | 0 to 1. A larger light.                                                                                                                   |
| `cell`               | `number`                             | `4`                 | Cell size in CSS pixels: 2, 4, 6 up to 16.                                                                                                |
| `speed`              | `number`                             | `0.6`               | 0 to 2. How fast the resting light drifts.                                                                                                |
| `scheme`             | `"light" \| "dark"`                  | follows the page    | Forces the palette's colour scheme. By default it reads a `dark` or `light` class (or `data-theme`) on `<html>`, then the system setting. |
| `params`             | `Partial<GradientParams>`            | none                | Any other engine param, applied last.                                                                                                     |
| `className`, `style` |                                      |                     | The outer box. Give it a size.                                                                                                            |
| `children`           | `ReactNode`                          | none                | Drawn above the light.                                                                                                                    |
