Skip to content
English
Spotlight card comes with Pro. Its preview shows once you unlock it.

How it works

Two decorative layers sit inside each card: a glow (solid colour under a radial mask) and a border light (a radial gradient revealed only on the 1px ring around the card). JS writes the pointer position to CSS variables, throttled with rAF. SpotlightGroup reads every card's position once and writes coordinates relative to each card, so one pointer lights several cards. Scrolling while hovering recomputes.

Use it for

  • Feature cards on a landing page, three or four in a row (use SpotlightGroup).
  • Pricing cards and product blocks on a dark theme that need a tactile feel.
  • Card grids where it helps to show where the pointer is, such as category entries.

Look elsewhere when

  • Mobile: there is no hover, so never rely on the light to convey information.
  • Dense admin lists and tables: the effect distracts.
  • Cards with gradient, dashed or thick borders: the border light only fits a 1px edge.

Usage

import { SpotlightCard, SpotlightGroup } from './SpotlightCard.jsx'

// A single card
<SpotlightCard size={320} intensity={0.7}>
  <h3>Instant sync</h3>
  <p>Changes reach every device in 2 seconds</p>
</SpotlightCard>

// In a group: the borders of neighbouring cards light up together
<SpotlightGroup color="#ffffff" style={{ display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: 12 }}>
  {features.map((f) => (
    <SpotlightCard key={f.id}>{f.title}</SpotlightCard>
  ))}
</SpotlightGroup>

Props

PropTypeDefaultWhat it does
sizenumber320Spot diameter in px. Cards inside a SpotlightGroup inherit the group's value.
intensitynumber0.7Strength from 0 to 1. Controls the glow (× 0.3) and the border light.
colorstring'var(--ds-accent)'Colour of the light. White works best on dark backgrounds.
childrenReactNode—Card content. By default the card has 20px padding, a 24px radius and no border: a hairline ring and a soft shadow (--ds-shadow-card) lift it, and the border light runs on that ring. Override with className or style.
...restHTMLAttributes<HTMLDivElement>—Other attributes go to the root <div> (same for SpotlightCard and SpotlightGroup).

Accessibility

  • Both light layers are aria-hidden decoration and do not affect screen readers or the keyboard.
  • Only mouse and pen respond; touch screens (hover: none) show nothing.
  • The light changes brightness only, with no movement, so it stays on under reduced motion; content contrast never depends on it.

Motion

Lights up in 160ms ease-out and fades in 360ms standard; pointer following is throttled to one update per frame.

Add it to your project

Pro members copy a prompt and their coding agent installs the source, the same way as the free components.

SpotlightCard.jsxspotlight-card.csstokens.cssREADME.md

Both files install together. The stylesheet reads the design tokens in tokens.css and carries fallbacks, so it also works alone.

Cards
Animated border card comes with Pro. Its preview shows once you unlock it.
Border beam comes with Pro. Its preview shows once you unlock it.
Card lock sheet comes with Pro. Its preview shows once you unlock it.