Skip to content

Open Spotlight Card with its live demo →

Spotlight Card

A card whose soft spotlight follows the pointer on hover.

Usage

Copy src/SpotlightCard.tsx into your React project. No extra dependencies.

tsx
import { SpotlightCard } from "./SpotlightCard";

export function Example() {
  return (
    <SpotlightCard>
      <h3>Hover me</h3>
      <p>The light follows your pointer.</p>
    </SpotlightCard>
  );
}

Props

PropTypeDefaultWhat it does
sizenumber220Spotlight diameter in pixels
colorstring"#6366f1"Spotlight colour as #rrggbb
intensitynumber0.18Spotlight opacity from 0 to 1
classNamestringExtra class on the card

Notes

  • Client component ("use client")
  • Spotlight uses CSS custom properties updated from pointer position
  • Respects prefers-reduced-motion (static soft glow instead)