Cursor Spotlight

Cursor spotlight effect. Dimmed background with bright radial gradient following cursor.

Last updated Mar 5, 2026

Component

Installation

pnpm dlx shadcn@latest add "https://pulkitxm.com/components/cursor-spotlight.json"

Usage

Import

Add the CursorSpotlight import.

import { CursorSpotlight } from "@/components/cursor-spotlight";

Use

Wrap content. Spotlight follows cursor.

<CursorSpotlight>Content</CursorSpotlight>;

Guidelines

  • Wrap content as children. Spotlight follows cursor within the container.
  • spotlightSize and spotlightOpacity control the effect.
  • baseColor sets the dimmed background color.

Props

All props are optional unless marked required. Use these to customize every aspect of the component.

PropTypeDefaultDescription
classNamestringAdditional CSS classes for the container.
spotlightSizenumber100Spotlight radius in pixels.
spotlightOpacitynumber0.25Spotlight opacity (0–1).
baseColorstring"rgb(2 6 23)"Base dimmed background color.
falloffstring"60%"Gradient falloff (e.g. '60%' = transparent at 60% from center).
childrenClassNamestringClasses for the children wrapper.

Examples

Basic

Basic spotlight container.

import { CursorSpotlight } from "@/components/cursor-spotlight";

<CursorSpotlight className="h-48 rounded-2xl border">
  <div className="flex h-full items-center justify-center">
    <span className="text-sm text-white/50">
      Move cursor for spotlight
    </span>
  </div>
</CursorSpotlight>;

Made with ❤️ by Pulkit & Cursor :)

© 2026 Pulkit. All rights reserved

DMCA Verified

Last updated: