Skip to content
Pixelbits
Docs / Spotlight card
Signature

Spotlight card

A card with a soft accent glow (and a pixel grid) that follows the pointer. The position is written to CSS variables on pointer move, so React never re-renders; keyboard focus inside the card lights it from the center.

Spotlight card

Follows the pointer

Installation

npm: import
import { SpotlightCard } from "pixelbits/spotlight-card";
shadcn: copy the source
npx shadcn add https://pixelbits.ali-moradi-develop.com/r/spotlight-card.json

API

<SpotlightCard>

A card with a soft accent glow (and a pixel grid) that follows the pointer. The position is written to CSS variables on pointer move, so React never re-renders; keyboard focus inside the card lights it from the center.

Example
<SpotlightCard className="p-6"><h3>Follows the pointer</h3></SpotlightCard>
PropTypeDefaultDescription
radiusnumber260

Radius of the glow in px.

gridbooleantrue

Also reveal a fine pixel grid under the pointer.

Also accepts every prop of HTMLAttributes<HTMLDivElement>.