SpotlightCard

Soft light that trails the cursor, optionally revealing a dot or grid texture only where it falls. Your layout classes apply straight to the card. Cards.

Open playground
Iris ValeA soft light follows you.
Hidden grainDots appear under the light.

About

SpotlightCard is a React component in the Cards category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { SpotlightCard } from "@ashutoshswamy/smoui" and set size, color, pattern.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
import { SpotlightCard } from "@ashutoshswamy/smoui";

<SpotlightCard className="flex items-center gap-3 rounded-2xl bg-neutral-100 p-6">
  <Avatar /> <span>A soft light follows you.</span>
</SpotlightCard>

// texture that only exists under the light
<SpotlightCard pattern="dots" className="rounded-2xl bg-neutral-100 p-8">...</SpotlightCard>

Props 3

size

Spotlight radius in px.

numberdefault 240
color

Any CSS color.

stringdefault currentColor at 14%
pattern

A texture revealed only where the light falls.

"none""dots""grid"default "none"