Spotlight card
ProA card whose border and surface catch the pointer's light.
Usage · November
$2,418
Move the pointer across the card.
When to use
- A feature card in a grid where the pointer should show which one is active.
- A single panel on a dark page that needs an edge without a heavy shadow.
When not to use
- A card whose job is a form or a dense table. The light fights the content.
- Touch-only layouts. Without a pointer there is nothing to track.
Usage
- Copy the prompt and set the highlight radius and the two opacities.
- Write the pointer position into CSS variables so the card does not re-render on move.
- Fade the glow out when the pointer leaves, and leave the card still on touch.
example.tsx
1import { SpotlightCard } from "@/effects/spotlight-card";2 3export function Preview() {4 return (5 <div className="h-64">6 <SpotlightCard />7 </div>8 );9}