Spotlight Card
Card with cursor-tracked radial spotlight effect on hover.
pnpm dlx @glinui/cli@latest add spotlight-cardInstant previews
Every pull request gets a live URL in seconds.
Learn moreSafe by default
Scoped tokens and signed builds on every plan.
Learn moreTeam insights
See who ships what, and how fast.
Learn moreInstallation$
pnpm dlx @glinui/cli@latest add spotlight-cardPrefer the package?
Usage$
SpotlightCard wraps Card and tracks the cursor position via CSS custom properties --spot-x and --spot-y to project a radial spotlight onto the card surface. Move your pointer over the preview above to see the effect.
Three feature cards share one slow looping pointer, so the accent spotlight and its border highlight stay visible without hovering (autoPlay). A real pointer takes over as soon as you hover. Reduced motion turns the loop off.
Examples$
Variants$
glinr is the default, plain is the flat shadcn look, solid is a neutral tonal face and glass is opt-in. Glass needs a backdrop, so the set below sits on a vivid one.
glinr
Crisp on any stage.
Learn moreplain
Crisp on any stage.
Learn moresolid
Crisp on any stage.
Learn moreglass
Opt-in. Needs a backdrop.
Learn moreimport { SpotlightCard } from "@glinui/ui"
// Omit variant to follow the ambient style (glinr by default).export function SpotlightCardVariants() {return ( <> <SpotlightCard variant="glinr"> ... </SpotlightCard> <SpotlightCard variant="plain"> ... </SpotlightCard> <SpotlightCard variant="solid"> ... </SpotlightCard> <SpotlightCard variant="glass"> ... </SpotlightCard> </>)}Colors$
The spotlight is an accent tint by default. Pass spotlightClassName with a --tone-* token to recolor it.
accent
The effect color follows the tone token.
Learn moresuccess
The effect color follows the tone token.
Learn morewarning
The effect color follows the tone token.
Learn moredanger
The effect color follows the tone token.
Learn moreinfo
The effect color follows the tone token.
Learn moreimport { SpotlightCard } from "@glinui/ui"
export function SpotlightCardTones() {return ( <SpotlightCard spotlightClassName="[background:radial-gradient(var(--spot-size,300px)_circle_at_var(--spot-x,_50%)_var(--spot-y,_50%),color-mix(in_oklab,var(--tone-success)_34%,transparent),transparent_70%)]"> ... </SpotlightCard>)}In a layout$
A mini dashboard section: three metric cards with a live spotlight above a plain activity list.
Overview
Last 7 days// A mini dashboard section: three metric cards with a live spotlight above a plain activity list.import { SpotlightCard } from "@glinui/ui"
export function SpotlightCardLayout() {return ( <section className="grid gap-4 sm:grid-cols-3"> ... </section>)}Accessibility$
- The spotlight overlay carries
aria-hidden="true"andpointer-events-noneso it is invisible to assistive technology and cannot intercept interactions. - All content inside the card remains fully keyboard-accessible and semantically structured.
SpotlightCarddoes not modify focus behavior, interactive children (buttons, links) work as expected.
Reduced Motion$
The spotlight overlay is hidden entirely when prefers-reduced-motion: reduce is set via motion-reduce:hidden. The underlying Card hover transition (transform, box-shadow) is also disabled via motion-reduce:transition-none and motion-reduce:hover:translate-y-0, ensuring zero motion for users who prefer it.
API Reference$
SpotlightCard$
Accepts all props from Card (which in turn accepts all div HTML attributes). The only additional prop is spotlightClassName.
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
autoPlay | boolean | No | false | Runs a slow looping synthetic pointer so the spotlight is visible without hovering (demos, screenshots, touch). Off at reduced motion. A real pointer takes over while hovering. |
spotlightClassName | string | No | - | Auto-generated from TypeScript source. |
spotlightSize | number | No | 300 | Spotlight radius in pixels. |
Source$
import { SpotlightCard } from "@glinui/ui"Generated API Snapshot
Beta
Generated API Snapshot
BetaAuto-extracted from TypeScript source in packages/ui/src/components/spotlight-card.tsx. This section is in beta and may lag behind hand-curated docs. Regenerate with pnpm --filter @glinui/docs api:generate.
Generated: 2026-10-08T01:41:21.546Z · Full index: /docs/api-metadata
Primary Props Type
SpotlightCardProps
SpotlightCardProps
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
autoPlay | boolean | No | false | Runs a slow looping synthetic pointer so the spotlight is visible without hovering (demos, screenshots, touch). Off at reduced motion. A real pointer takes over while hovering. |
spotlightClassName | string | No | - | - |
spotlightSize | number | No | 300 | Spotlight radius in pixels. |