Spotlight Card
ProA card with a light that follows the pointer and traces the border.
Installation
pnpm dlx shadcn@latest add @viewport/spotlight-card
First time? Add the @viewport registry to components.json. Setup takes one minute.
Usage
The code behind the preview above comes with Truffle Pro.
Props
| Prop | Type | Default |
|---|---|---|
| color | stringSpotlight color. Any CSS color. | "color-mix(in oklch, var(--brand) 55%, transparent)" |
| size | numberSpotlight diameter in pixels. | 360 |
Accessibility
- Effect layers are aria-hidden and never intercept clicks.
- Pointer position is written to CSS variables with no re-renders.
- Content stays fully readable without the effect.