Skip to content
Thrum

Spotlight card

A card whose surface and border light up around the pointer, for a grid of features or plans that invites a closer look. Inside it is the card: build it from the same parts. For a light that runs round the border on its own, use the border beam.

Install

npx shadcn@latest add @thrum-pro/spotlight-card

This is a Pro component. The command works once your project has a licence key: set up Pro or see pricing.

Props

PropTypeDefaultDescription
sizenumberDefault 240The radius of the glow around the pointer, in pixels. Anything under 16 is drawn as 16.
ambientbooleanDefault trueShow a subtle resting upper-left spotlight sheen before pointer hover or keyboard focus.
childrenReactNode–The card's parts: CardHeader, CardTitle, CardDescription, CardAction, CardContent and CardFooter from the card.
classNamestring–Extra classes, merged last. Set the width here.
...propsComponentProps<"div">–Every other div attribute and event handler is passed through to the card. An onPointerMove of yours runs before the glow moves.

Motion and sound

Motion

  • While the pointer is over the card, a soft glow of the primary colour at 18% follows it across the surface, and the border near it takes the primary colour at 85%. Both fade in and out over 200 ms, replacing the resting ambient sheen.
  • The pointer's position is written into two CSS variables on the card by one pointermove listener. React does not re-render as the pointer moves.
  • Touch: nothing. A touch screen never sees the glow.
  • Keyboard focus inside the card lights it, from the middle of its top edge or from where the pointer last was, and the light stays still.
  • Reduced motion: the glow does not follow the pointer and does not appear on hover. Focus inside the card still lights it from the top.

Sound

Silent. This component makes no sound.

Accessibility

  • It is the card: a plain div with no role. Name it the way the card says, with a heading in CardTitle or with role="region" and an aria-label.
  • Both glow layers sit under the content and are hidden from screen readers. The surface glow is the primary colour at 18%, so text keeps its contrast at every pointer position.
  • Under a glass material the card turns translucent like any card, and the glow is drawn on that surface.
KeysAction
TabMoves to the controls inside the card. While one has focus, the card is lit.

Source

SourcePro

The source comes with Pro

TypeScript source · Copy-paste ready · MIT-compatible for client projects · Includes all dependencies

Files and dependencies

Adds
components/ui/spotlight-card.tsx
Packages
motion
Brings along
CardMotion tokens

Changelog

  1. 1.0.0 · 2026-12-03First release.

Loading index…

Keyboard shortcuts

/Ctrl KSearch components, docs and actions
?Show this list
AAppearance studio
SSound on or off
MFull or reduced motion
TTheme: auto, light, dark
GSurface: solid or frosted
BBackdrop photograph (under glass)
CCorner radius: square to round
RReplay the demo, on a component page
DDraw new data, on a component page
←→HomeEndMove the cursor in a focused chart
EscClose a dialog, or leave a chart cursor