Glin UI
Signature / Molecule

Spotlight Card

Card with cursor-tracked radial spotlight effect on hover.

Instant previews

Every pull request gets a live URL in seconds.

Learn more

Safe by default

Scoped tokens and signed builds on every plan.

Learn more

Team insights

See who ships what, and how fast.

Learn more

Installation$

Install from
pnpm dlx @glinui/cli@latest add spotlight-card

Prefer 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 more

plain

Crisp on any stage.

Learn more

solid

Crisp on any stage.

Learn more

glass

Opt-in. Needs a backdrop.

Learn more
import { 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 more

success

The effect color follows the tone token.

Learn more

warning

The effect color follows the tone token.

Learn more

danger

The effect color follows the tone token.

Learn more

info

The effect color follows the tone token.

Learn more
import { 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
Revenue$48.2k+12.4%
Active teams1,284+4.1%
Deploys9,310+18%
Recent activity
Maya shipped v2.4just now
Build 8812 passedjust now
Sam invited 3 teammatesjust now
// 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" and pointer-events-none so it is invisible to assistive technology and cannot intercept interactions.
  • All content inside the card remains fully keyboard-accessible and semantically structured.
  • SpotlightCard does 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.

PropTypeRequiredDefaultDescription
autoPlaybooleanNofalseRuns 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.
spotlightClassNamestringNo-Auto-generated from TypeScript source.
spotlightSizenumberNo300Spotlight radius in pixels.

Source$

import { SpotlightCard } from "@glinui/ui"
packages/ui/src/components/spotlight-card.tsx

Generated API Snapshot

Beta

Auto-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

PropTypeRequiredDefaultDescription
autoPlaybooleanNofalseRuns 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.
spotlightClassNamestringNo--
spotlightSizenumberNo300Spotlight radius in pixels.