Skip to content

Spotlight Card for React

A spotlight card for React: a glass card lit by a soft glow that follows the pointer, written straight to CSS variables.

npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/spotlight.json

Fast

Transforms only.

Calm

Light, not noise.

Feature grid

In a SpotlightGroup every card shares the pointer, so the rims of neighboring cards light up as you move between them. On touch screens the glow rests near the top of each card.

Instant previews

Every branch gets its own URL, ready before the review starts.

Edge caching

Pages are served from the region closest to each visitor.

Zero-config TLS

Certificates are issued and renewed for you, on every domain.

Rollbacks

Go back to any earlier deploy in one click, with no rebuild.

Live logs

Stream function logs as they happen, filtered by route.

Team roles

Owners, members and viewers, with audit history for each.

Files to copy

5 folders · 5 files · 4 packages
From theme/src/
  • components/spotlight/
  • hooks/{use-latest.ts, use-media-query.ts, use-preferences.ts}
  • motion/light-follower.ts
  • lib/cn.ts
  • styles/
shadcn CLI
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/spotlight.jsonRegistry item: spotlight. The styles need the Tailwind v4 glass UI setup.
The examples also use
  • components/badge/
  • components/button/
  • components/spinner/
  • hooks/use-magnetic.ts
  • motion/{gate.ts, tokens.ts}
  • lib/{form.ts, state-light.tsx, warn-once.ts}
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/badge.json https://lokendra-builds.github.io/sheenui/r/button.json
Packages
pnpm add @base-ui/react clsx motion tailwind-merge

Any CSS color works for the glow and the rim. Keyboard focus inside the card lights it too.

Pro

Most popular

$24/mo

  • Unlimited projects
  • Preview deployments
  • Priority support
Choose Pro

SpotlightCard props

PropTypeDefaultDescription
colorstringa soft accentColour of the glow inside the card (any CSS colour).
level2 | 1 | 32Sets the glass level: 1 = subtle, 2 = cards (default), 3 = most opaque.
tintbooleanfalseTints the surface with the accent colour.
diameternumberthe card's width, at most 380pxSets the diameter of the glow in px.
rimColorstringthe accentSets the colour of the light on the rim.
rimbooleantrueMakes the rim light up near the pointer.

SpotlightGroup props

PropTypeDefaultDescription
...propsdiv propsNoneA plain div that shares one pointer with every SpotlightCard inside it. Lay the cards out with className.

Keyboard

KeysAction
TabNot focusable: a plain card is not focusable. Keyboard focus inside the card lights it too, so interactive children are never in the dark.

Accessibility

  • No role of its own; reading order is the DOM order. SpotlightGroup shares one pointer listener across the cards.
  • The glow and rim are aria-hidden and hidden in forced colors. On touch screens the glow is static.

When to use the spotlight card effect

  • Use it as a cursor glow effect for a feature grid on a landing page, where a soft glow follows the pointer across each glass card and the rim lights up as the cursor nears an edge.
  • Use it for pricing tiles or integration cards in a dashboard, with tint to give one accent-colored tile more weight than its neighbors.
  • Wrap neighboring cards in SpotlightGroup so a card's rim picks up the light even while the pointer is still over the next card, as on Linear-style grids.
  • Skip it when you want a calm surface or a card that physically leans: use GlassCard for static panels and TiltCard for 3D movement toward the pointer, since glow adds noise to dense lists.
  • Pair it with SpotlightGroup for the grid, Badge for a plan label, and Button or Switch inside the cards, which keep their own focus rings while the glow reacts to focus.

Frequently asked questions

19 effects pages in all: browse them on All effects.

By Lokendra Singh Rathore (GitHub, opens in a new tab). Published , updated .