Skip to content

Spotlight Card

A soft highlight that follows the pointer across your card.

LIVE PREVIEWInteract with the component
Just React. No extra dependencies.

Copy the component and its CSS module into your project.

CSS Modules

Usage

Matches your current playground settings.

jsx
import SpotlightCard from "./SpotlightCard";
export default function Example() {
return (
<SpotlightCard
children={"Hover here."}
spotlightColor={"#b8a7ed"}
radius={320}
intensity={0.16}
/>
);
}

Using Spotlight Card

Wrap your content in children. radius controls the highlight's footprint and intensity controls how strongly it appears.

Choose spotlightColor to complement the surface. The highlight is decorative, so selected or important states should also be clear in the card's content.

Props

NameTypeRequiredDefaultDescription
childrenReactNodeNoundefinedYour content. No demo content is rendered by default.
spotlightColorstringNo"#b5f5d1"Spotlight color
radiusnumberNo320Spotlight radius
intensitynumberNo0.16Glow intensity
classNamestringNo""Additional CSS class names, merged with base component styles.
styleCSSPropertiesNoundefinedInline styles for caller-defined sizing and visual overrides.
onPointerMovefunctionNoundefinedOptional caller pointer-move handler.
onPointerLeavefunctionNoundefinedOptional caller pointer-leave handler.

Related components

A moving gradient border around your content.

A paper flap lifts in 3D as a message slides out of its envelope.

A lightly textured receipt pairs precise item rows with a torn paper edge.

A suspended badge swings naturally after you drag and release its handle.