Components / Cards
Spotlight Card
A card with a soft radial spotlight that follows the pointer.
Lightning fast
Move your cursor here
A soft spotlight follows the pointer, making cards feel alive without getting in the way of the content.
Installation
Requires React 18+ and Tailwind CSS.
- 1
Install dependencies
None. This component only needs React and Tailwind.
- 2
Add the component
Copy the code from the Code tab above into
components/ui/spotlight-card.tsx. - 3
Use it
example.tsximport { SpotlightCard } from "@/components/ui/spotlight-card"; export default function SpotlightCardDemo() { return ( <SpotlightCard className="w-full max-w-sm"> <p className="text-sm font-medium text-orange-600 dark:text-orange-300">Lightning fast</p> <h3 className="mt-2 text-xl font-semibold text-zinc-900 dark:text-white">Move your cursor here</h3> <p className="mt-2 text-sm leading-relaxed text-zinc-600 dark:text-zinc-400"> A soft spotlight follows the pointer, making cards feel alive without getting in the way of the content. </p> </SpotlightCard> ); }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| spotlightColor | string | "rgba(251,146,60,0.18)" | Color at the center of the spotlight. |
| size | number | 360 | Spotlight diameter in pixels. |
| ...props | ComponentProps<"div"> | — | Any native div prop. |