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.jsonFast
Transforms only.
Calm
Light, not noise.
SpotlightCardSpotlightGroup
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.
import { SpotlightCard, SpotlightGroup } from "@/components/sheenui/spotlight/spotlight";
// Package build (after the first npm release, or a packed tarball): import { SpotlightCard, SpotlightGroup } from "@sheenui/theme";
const features = [
{ title: "Fast", body: "Compositor-only animation.", icon: "⚡" },
{ title: "Accessible", body: "Keyboard and screen reader tested.", icon: "♿" },
{ title: "Themeable", body: "Tokens for every color.", icon: "🎨" },
];
export function Example() {
return (
<SpotlightGroup className="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
{features.map((feature) => (
<SpotlightCard key={feature.title} className="p-6">
<span className="grid size-10 place-items-center rounded-sheen-md bg-sheen-accent-soft text-sheen-accent">
{feature.icon}
</span>
<h3 className="mt-4 font-semibold">{feature.title}</h3>
<p className="mt-1 text-sm text-pretty text-sheen-fg-muted">{feature.body}</p>
</SpotlightCard>
))}
</SpotlightGroup>
);
}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.tslib/cn.tsstyles/
- 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.tsmotion/{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
Custom colors, as a link
Any CSS color works for the glow and the rim. Keyboard focus inside the card lights it too.
import { Badge } from "@/components/sheenui/badge/badge";
import { Button } from "@/components/sheenui/button/button";
import { SpotlightCard } from "@/components/sheenui/spotlight/spotlight";
// Package build (after the first npm release, or a packed tarball): import { Badge, Button, SpotlightCard } from "@sheenui/theme";
// This example also uses badge, button: npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/badge.json https://lokendra-builds.github.io/sheenui/r/button.json
export function Example() {
return (
<SpotlightCard
tint
color="color-mix(in oklab, var(--sheen-accent-2) 18%, transparent)"
rimColor="var(--sheen-accent-2)"
className="flex w-full max-w-sm flex-col gap-4 p-6"
>
<div className="flex items-center justify-between gap-3">
<h3 id="pro" className="text-lg font-semibold">Pro</h3>
<Badge tone="accent">Most popular</Badge>
</div>
<p className="text-4xl font-semibold tracking-tight">
$24<span className="text-sm font-normal text-sheen-fg-muted">/mo</span>
</p>
<ul className="flex flex-col gap-2 text-sm text-sheen-fg-muted">
<li>Unlimited projects</li>
<li>Preview deployments</li>
<li>Priority support</li>
</ul>
<Button render={<a href="#pricing" />} fullWidth>
Choose Pro
</Button>
</SpotlightCard>
);
}SpotlightCard props
SpotlightGroup props
Keyboard
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
Related pages
19 effects pages in all: browse them on All effects.
By Lokendra Singh Rathore (GitHub, opens in a new tab). Published , updated .