znverse

← Spotlight Card

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>
  );
}

Notes

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