Signature / Molecule
Spotlight
Full-page spotlight overlay for onboarding and feature highlighting.
pnpm dlx @glinui/cli@latest add spotlightInstallation$
Install from
pnpm dlx @glinui/cli@latest add spotlightPrefer the package?
Usage$
Spotlight is a "use client" component. It renders a full-viewport overlay with a transparent circular cutout at the specified position, great for onboarding tours and feature highlighting.
Examples$
With Pulse$
The pulse variant adds a pulsing ring around the spotlight cutout.
"use client"import { Spotlight } from "@glinui/ui"
export function SpotlightPulseDemo() {return ( <Spotlight active x="50%" y="50%" size={100} pulse onDismiss={() => {}} />)}Accessibility$
- When
onDismissis provided, the overlay becomes a focusable button witharia-label="Dismiss spotlight". - Supports keyboard dismissal via Enter and Space keys.
- Without
onDismiss, the overlay is a passive visual element.
Reduced Motion$
The pulse ring animation is paused via motion-reduce:[animation:none].
API Reference$
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
active | boolean | No | true | Whether the spotlight is active |
onDismiss | () => void | No | - | Click overlay to dismiss |
overlayColor | string | No | "rgba(0, 0, 0, 0.7)" | Overlay color |
pulse | boolean | No | false | Pulsing animation |
size | number | No | 150 | Spotlight radius in px |
x | number | string | No | "50%" | X position of spotlight center (px or %) |
y | number | string | No | "50%" | Y position of spotlight center (px or %) |
Source$
import { Spotlight } from "@glinui/ui"packages/ui/src/components/spotlight.tsx
Generated API Snapshot
Beta
Generated API Snapshot
BetaAuto-extracted from TypeScript source in packages/ui/src/components/spotlight.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
SpotlightProps
SpotlightProps
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
active | boolean | No | true | Whether the spotlight is active |
onDismiss | () => void | No | - | Click overlay to dismiss |
overlayColor | string | No | "rgba(0, 0, 0, 0.7)" | Overlay color |
pulse | boolean | No | false | Pulsing animation |
size | number | No | 150 | Spotlight radius in px |
x | number | string | No | "50%" | X position of spotlight center (px or %) |
y | number | string | No | "50%" | Y position of spotlight center (px or %) |