Skip to content
All terms
Components/lexicon/spotlight-card

What is a spotlight card?

also known asspotlight effect · cursor-tracking glow · flashlight card · aurora card

A spotlight card is a UI card with a soft glow that follows your cursor across its surface, like a flashlight sweeping over a dark wall.

Made ofA card with a radial gradient that follows the pointer, driven by two CSS variables set from a pointermove handler.

Key CSSbackground: radial-gradient(circle at var(--mx) var(--my), rgb(255 255 255 / 0.12), transparent 40%)
01 · Definition

Dark cards have a problem: they just sit there. Two shades of near-black and a faint border, perfectly tasteful, perfectly inert. The spotlight card fixes that by shining a light on them, and the light follows your mouse.

Move the cursor over the card and a soft radial glow appears right under it, brightening the surface and catching the card's thin border like light on the rim of a glass. Move away and it fades. The effect is quiet enough that many people only notice it after a few seconds, and then they keep waving the cursor around to see it again. That small invitation to play is the entire value.

It turned up on dark marketing pages for developer tools and AI products, where pricing and feature cards need to feel more premium than a static rectangle allows. The look pairs naturally with a hairline border, a dark surface and restrained color.

The implementation is lightweight, which is a good part of its popularity. A pointer listener on the card reads the cursor position relative to the card and writes two numbers into CSS custom properties, such as --x and --y. A pseudo-element on the card draws a radial gradient centred on those coordinates. Because the browser only has to update two variables and repaint a gradient, you do not need an animation library or a state update on every mouse move. You can enrich it by masking a second, brighter gradient to appear only along the border, so the edge lights up while the surface glows gently.

Where it goes wrong is in volume. A grid of ten or twelve cards, all with their own lights, becomes visual noise as the cursor sweeps across the page. A glow in a saturated color looks like a gaming accessory, and a big, bright spotlight drowns the content in the card. It can also be inconsistent: it needs a dark surface to show up, so on light themes it either disappears or looks like a smudge. And it does nothing on touch screens, since there is no cursor.

Some ground rules for doing it well:

  • Keep the gradient soft, with a radius of 200 to 300px and low opacity.
  • Use a muted, desaturated color, or just a pale neutral, for the glow.
  • Add a hairline border at low opacity that the glow can brighten.
  • Limit it to a handful of cards in one view.
  • Activate it only for fine pointers, using the pointer: fine media query, and make sure the card still looks finished without it.
  • Do not let the effect hide behind essential information. Never put the only cue for an action in the glow.
  • Do not stack it with other cursor effects, such as a magnetic pull, on the same element.

For AI prompts, describe the mechanism, not just the mood. Ask for a card whose pointermove handler sets --x and --y custom properties, a ::before pseudo-element with a radial-gradient of 240px at those coordinates, 8 percent white border, dark surface, and a fallback with no glow on touch devices. If you only say add a cool hover glow, you will usually get a generic box shadow.

Use when
  • Pricing cards on dark-mode marketing pages
  • Feature cards on developer tools and AI products
  • Hero CTAs that need to feel premium without animation
Avoid when
  • Light-mode UIs, the effect needs darkness to read
  • Touch-first products, there's no cursor to track
  • Dense card grids (10+ cards), too many spotlights = chaos
02 · Do
  • +Use a 1px hairline border at ~8% white, the spotlight makes it shimmer
  • +Keep the radial gradient soft (200–300px radius, 30–40% opacity)
  • +Limit to 2–4 cards per section, the effect needs breathing room
  • +Disable on `(pointer: coarse)` for touch devices
03 · Don't
  • −Don't use saturated primary colors for the glow, keep chroma muted
  • −Don't combine with a magnetic cursor on the same card, too much interaction
04 · Prompt your AI

AI tools already know the word. Here is how to avoid the stock version.

The stock versionA dark grid of cards where a purple glow follows the cursor across every card at once, always on.

  • +Light only the card under the pointer, and let the border ring glow more than the fill.
  • +Use a neutral white glow at 6% to 10% opacity and keep brand color for one hero card.
  • +Switch it off for touch input and for reduced motion, and make sure nothing depends on the glow to be readable.
  • +Drive it with CSS variables set from a pointermove handler so moving the pointer never re-renders.
06 · Common questions

Spotlight Card: your questions, answered

What is a spotlight card?

A spotlight card is a card component with a soft radial glow that tracks the cursor over its surface. It is usually used on dark backgrounds with a thin, low-opacity border that catches the light. It makes otherwise flat cards feel responsive and a little more premium.

How do you build a spotlight card effect?

Listen for pointermove on the card, store the cursor's x and y position in CSS custom properties, and draw a radial-gradient on a pseudo-element centred on those variables. No animation library is needed, and the browser only updates two values per movement, so it stays cheap.

Does the spotlight effect work on touch devices?

No, because touch screens have no hovering cursor. Enable the effect only when a fine pointer is present, using the pointer: fine media query, and make sure the card looks complete without any glow. Never rely on the effect to communicate something important.

Does a spotlight card work on light backgrounds?

Rarely. The effect depends on contrast between a dark surface and a luminous glow. On light themes the glow is nearly invisible or looks like a stain. If you need a light version, use a subtle darker tint or a shadow shift instead.

People also ask

More quick answers

How many spotlight cards are too many?

Two to four in a single view is comfortable. Beyond that, a whole grid of cards glowing as the cursor travels becomes distracting.

Is the spotlight card accessible?

The effect is decorative, so it should never carry meaning. Keep text contrast high without the glow, and provide visible keyboard focus styles that do not depend on the cursor.

Spotlight card vs magnetic cursor: what is the difference?

A spotlight card changes how a surface is lit. A magnetic cursor changes where an element moves. They are best kept on separate components.

What border works best with a spotlight?

A one pixel hairline at roughly 8 percent white. The glow can brighten it, which sells the sense of light.

Does a spotlight card need dark mode?

Effectively yes. A dark surface is what makes the glow visible, because the light needs something dim to fall on in order to show contrast.

07 · Related terms
Free and open source

Found this useful? A GitHub star helps other designers find it.

Star on GitHub