Skip to content
Browse docs and components

Spotlight Card

spotlight-card

A card lit by the pointer: a soft wash follows the cursor and the nearest stretch of border catches the light. Tracked through CSS variables, so it never re-renders, and keyboard focus inside lights it too.

Responsive

Install

$npxshadcnadd@forme/spotlight-card

Adds the component, its registry dependencies, and the token stylesheet you import once.

Usage

import { SpotlightCard } from "@/components/forme/spotlight-card/spotlight-card";

<div className="grid gap-4 sm:grid-cols-3">
  {features.map((feature) => (
    <SpotlightCard key={feature.title} className="p-5">
      <h3>{feature.title}</h3>
    </SpotlightCard>
  ))}
</div>

When to use

Reach for it

  • Grids of feature or pricing cards on a marketing page, where the light ties the grid into one surface.

Use something else

  • Cards in product UI that people scan quickly; the wash competes with the content.

API reference

Read from the source, so it is the API of the file you install. A prop marked * is required.

Parts

  • SpotlightCardTakes <div> attributes

Accessibility

  • With keyboard focus inside, the rim lights from the centre, so focus is never quieter than hover.
  • The light is decoration only; nothing is hidden behind the hover.

Motion

  • The pointer's position is written to two custom properties, not React state, so following it costs no renders.

Responsive behaviour

  • Touch input is ignored: on a phone it is simply a card.