Skip to main content
Clever Ops

Spotlight Card

Card with a primary-tinted spotlight that follows the pointer while the hairline border brightens beneath it. Touch and keyboard users get a designed fallback glow.

Preview & code

Loading Spotlight Card preview

Installation

pnpm dlx shadcn@latest add @cleverui/card-spotlight

Requires the @cleverui registry in your components.json, a one-off, two-line setup.

Usage

tsx
import { CardSpotlight } from '@/components/ui/card-spotlight'
Exampletsx
import { Workflow, ShieldCheck, Timer } from 'lucide-react'
import { CardSpotlight } from '@/components/ui/card-spotlight'

const cards = [
  {
    icon: Workflow,
    title: 'Chained approvals',
    body: 'Route invoices through the right owner automatically, finance sees only what crosses their threshold.',
  },
  {
    icon: ShieldCheck,
    title: 'Guardrails built in',
    body: 'Every automated action is logged, reversible, and scoped to the permissions you set on day one.',
  },
  {
    icon: Timer,
    title: '38 hours back, monthly',
    body: 'The median team stops doing manual handoffs within two weeks of switching on autopilot.',
  },
]

export default function CardSpotlightDemo() {
  return (
    <div className="mx-auto grid min-h-[480px] max-w-5xl items-center gap-5 px-6 py-20 sm:grid-cols-3">
      {cards.map(({ icon: Icon, title, body }) => (
        <CardSpotlight key={title}>
          <div className="p-6">
            <Icon className="size-5 text-primary" aria-hidden="true" />
            <h3 className="mt-4 font-medium text-card-foreground">{title}</h3>
            <p className="mt-2 text-sm leading-relaxed text-muted-foreground">{body}</p>
          </div>
        </CardSpotlight>
      ))}
    </div>
  )
}

The example itself also uses lucide-react , install it too if you copy the example as-is (the component itself does not need it).

API reference

CardSpotlight accepts the following props.

PropTypeDefaultDescription
radiusnumber260spotlight radius in px
children*React.ReactNode

…plus everything from React.HTMLAttributes<HTMLDivElement>: className, event handlers, aria attributes and the rest pass straight through.

Frequently asked questions

How do I install the Spotlight Card component?

Register the @cleverui registry in your components.json ("@cleverui": "https://cleverops.com.au/r/{name}.json"), then run `npx shadcn@latest add @cleverui/card-spotlight`. The shadcn CLI copies the source into your project, you own the code from that point. You can also copy the source directly from this page.

What dependencies does Spotlight Card require?

Spotlight Card uses motion on top of React and Tailwind CSS. You don't need to install it manually, the shadcn CLI resolves and installs npm dependencies automatically when you add the component.

Can I theme Spotlight Card to match my brand?

Yes. The component is styled entirely with Tailwind utilities over standard design tokens (primary, background, muted, border), so it inherits your existing shadcn/ui theme automatically. Change your CSS variables and the component follows, no source edits needed for palette, radius, or fonts.

Want this built for you?

CleverUI is built by the Clever Ops web team. If you'd rather ship a hand-coded, fast, custom website than assemble one, we build them for Australian businesses every week.

Explore web development services