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
| Prop | Type | Default | What it does |
|---|---|---|---|
size | number | 220 | Spotlight diameter in pixels |
color | string | "#6366f1" | Spotlight colour as #rrggbb |
intensity | number | 0.18 | Spotlight opacity from 0 to 1 |
className | string | Extra 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)