asafefe.dev
Lab

Lab/04

Spotlight Card

A card that tilts in perspective toward the pointer, with a radial glow following it.

  • Motion
  • Interaction
Hover the card

Efe 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-card

Or by URL: https://asafefe.dev/r/lab-spotlight-card.json

Brings along

  • motion
  • utils
  • @soultel/use-reduced-motion-safe

Usage

example.tsx9 lines
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

PropTypeDefaultDescription
colorstring"var(--primary)"Glow and edge color. Any CSS color.
tiltnumber6Max tilt in degrees. 0 turns it off.
glowSizenumber420Glow diameter in px.