Code
In context
Install · Free Web Component
One file, no dependencies. Aurora preset, every other option included. Host it yourself so your visitors never load anything from our servers.
The shadcn command adds a typed React wrapper for you. Using the file directly? Custom elements work in React as-is; for type checking add:
Pro · React + TypeScript Pro
One payment of $4.99, yours forever. Use it in unlimited personal and commercial projects; no resale.
- React components
SpotlightCardandSpotlightGroupwith TypeScript types and the full source - Sunset, Mint and Mono tints for the light, plus custom tints from Brand Fit
- The vanilla Web Components with every tint, a demo page, README and license
Attributes & props
| Name | Type | Default | Description |
|---|---|---|---|
| children | elements | — | The card content. Links and buttons inside work as usual; the light layers never take the pointer. |
| size | number (px) | 300 | Radius of the light. Larger than the gap between cards, and the neighbours catch it. |
| radius | number (px) | 20 | Corner radius of the card. |
| theme | 'light' | 'dark' | 'light' | A white card with a deep-coloured light, or a dark card with a bright one. |
| tint Pro | 'aurora' | 'sunset' | 'mint' | 'mono' | object | 'aurora' | The colours of the light, or a custom tint. Free build ships Aurora only. |
| <spotlight-group> | element | — | A wrapper with no look of its own (lay it out as a grid or a row). Every spotlight-card inside, at any depth, shares one light. |
| setPoint(x, y) / clearPoint() | methods | — | On a card or a group: place a virtual pointer, 0–1 across its box, and take it away. The same through the data-x / data-y attributes. |
| --sc-pad | CSS length | 22px | Padding inside the card. |
The light is three CSS gradients per card, positioned by two custom properties; one animation frame updates them, and only while the light is moving or fading. It trails the pointer by a hair and takes a moment to come up and die down, so it reads as a lamp rather than a cursor. When focus arrives from the keyboard, the light settles on the centre of the focused card. Outside a group each card has its own light. With reduced motion the light jumps instead of gliding. Nothing is drawn on a canvas.
More components
- Frost Card
- Holo Card
- Lens Compare
- Beam Border
- Scratch Reveal
- Tide Slide
- Pearl Code
- Ink Sphere
- Stream Text
- Pearl Dial
- Nova Rating
- Pearl Check
- Pearl Input
- Glass Toast
- Pearl Select
- Glass Sheet
- Pearl Accordion
- Glass Tip
- Pearl Calendar
- Glass Nav
- Pearl Tabs
- Glass Command
- Halo Avatar
- Pearl Steps
- Pearl Skeleton
- Pearl Table
- Pearl Chip
- Pearl Empty
- Roll Counter
- Glass Marquee
- Reveal Text
- Mesh Gradient
- Silk Waves
- Dot Field
- Plasma Orb
- Voice Wave
- Plush Buddy
- Gummy Agent
- Glass Tabbar
- Glass Menu
- Pearl Pricing
- Glass Bento
- Quote Wall
- Glass Cta
- Magnet Button
- Glass Sidebar
- Pearl Pagination
- Pearl Breadcrumb
- Glass Dock
- Pearl Slider
- Pearl Segmented
- Liquid Metal Button
- Mercury Orb
- Prompt Input
- Voice Orb
- Aurora Ring
- Glass Toggle
- Firefly Button
- Pearl Button
- Pearl Loader
- Alien Face
- Prism Button
- Liquid Carousel
- Orbit Carousel
- Deck Carousel