Cursor Spotlight

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

Component

Installation

 

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
classNamestring-Additional 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).
childrenClassNamestring-Classes 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>;

Last updated on Mar 5

Made with ❤️ by Pulkit & Cursor :)

© 2026 Pulkit. All rights reserved

DMCA Verified

Last updated: