Lab/04
Spotlight Card
A card that tilts in perspective toward the pointer, with a radial glow following it.
- Motion
- Interaction
Hover the card
lab/spotlight-cardEfe Bağ
Full-Stack Developer, Pécs
Self-taught developer building web applications with React, Next.js, and TypeScript. Currently running Coadite, a small software studio.
- 9+
- Years
- 4
- Projects
Installation
Add Spotlight Card to your project with the shadcn CLI. The files land in components/lab, ready to edit.
$ pnpm dlx shadcn@latest add @soultel/lab-spotlight-cardOr by URL: https://asafefe.dev/r/lab-spotlight-card.json
Brings along
- motion
- utils
- @soultel/use-reduced-motion-safe
Usage
import { SpotlightCard } from "@/components/lab/spotlight-card"
export function Example() {
return (
<SpotlightCard className="max-w-sm">
<div className="p-6">Hover me</div>
</SpotlightCard>
)
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
| color | string | "var(--primary)" | Glow and edge color. Any CSS color. |
| tilt | number | 6 | Max tilt in degrees. 0 turns it off. |
| glowSize | number | 420 | Glow diameter in px. |
