Cursor Glow

A dithered spotlight that follows the pointer.

Cursor Glow behind a hero
Still frame

Installation

pnpm dlx shadcn@latest add @gradients-pro/cursor-glow

Needs a Pro account and the Pro registry setup.

Usage

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

PropTypeDefaultDescription
palette"ultramarine" | "ember" | "mono""ultramarine"A curated ramp that follows light and dark mode. Ignored when colors is set.
colorsstring[]none2 to 6 CSS colours from the faintest light to the hottest, var(--x) included.
backgroundstringvar(--background)The surface outside the light.
follownumber10 to 1. How closely the light follows the pointer; 0 leaves it drifting at rest.
softnessnumber0.450 to 1. A larger light.
cellnumber4Cell size in CSS pixels: 2, 4, 6 up to 16.
speednumber0.60 to 2. How fast the resting light drifts.
scheme"light" | "dark"follows the pageForces the palette's colour scheme. By default it reads a dark or light class (or data-theme) on <html>, then the system setting.
paramsPartial<GradientParams>noneAny other engine param, applied last.
className, styleThe outer box. Give it a size.
childrenReactNodenoneDrawn above the light.