SG
Components

Spotlight Card

A card whose border and background glow follow the pointer.

interaction

01 / spotlight

Move your cursor here

A border and glow follow your pointer, using CSS variables only.

Features

  • Pointer position is written to CSS variables, so React never re-renders on move.
  • Glow shows on both the 1px border and the background.
  • Configurable color and spotlight size.

Why I built this

I like interfaces that respond to you before you click. A light that follows the cursor makes a static grid of cards feel tactile.

Most versions I found re-rendered on every mouse move. Keeping it in CSS variables made it smooth and simple.

Sidd

Usage

example.tsx
<SpotlightCard color="rgba(56,189,248,.35)">...</SpotlightCard>