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 component with TypeScript types and the full source, plus a ref with
setPoint/clearPointto drive the lens yourself - Sunset, Mint and Mono tints for the lit dots, plus custom tints from Brand Fit
- The vanilla Web Component with every tint, a demo page, README and license
Attributes & props
| Name | Type | Default | Description |
|---|---|---|---|
| children | elements | — | Rendered on top of the dots. The field fills the box of the element, so give it a height (or let the content set one). |
| gap | number (px) | 22 | Distance between dots. Dot size follows it. Very large areas widen the gap by themselves to stay fast. |
| radius | number (px) | 130 | How far the pointer reaches: the size of the lens. |
| idle | 'true' | 'false' | 'true' | A slow wave of light crosses the field when the pointer is away. Off leaves a still grid that only answers the pointer. |
| theme | 'light' | 'dark' | 'light' | Ink-blue dots for a light page, pale dots that glow for a dark one. The background stays transparent: the page shows through. |
| tint Pro | 'aurora' | 'sunset' | 'mint' | 'mono' | object | 'aurora' | The colours the lit dots take, or a custom tint. Free build ships Aurora only. |
| setPoint(x, y) / clearPoint() | methods | — | Place a virtual pointer, 0–1 across the box, and take it away. The same through the data-x / data-y attributes. |
| --dotf-mask | CSS mask image | none | A mask for the dots only, e.g. a radial gradient so the grid fades out toward the edges. |
Everything is drawn on one 2D canvas, sized by a ResizeObserver and capped at 2× pixel density. The pointer is read from the window, so the lens also works when the field lies behind other content. Each dot is a small spring: it is pushed away from the pointer in proportion to its distance, which is what makes the centre look magnified and the rim crowded. The loop stops while the field is off-screen or the tab is hidden, and when the idle wave is off it stops as soon as the dots have settled. With reduced motion the dots light under the pointer but do not move, and the wave stands still.
More components
- Mesh Gradient
- Silk Waves
- Tide Slide
- Pearl Code
- Ink Sphere
- Frost Card
- Holo Card
- Stream Text
- Lens Compare
- 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
- Plasma Orb
- Voice Wave
- Plush Buddy
- Gummy Agent
- Glass Tabbar
- Glass Menu
- Pearl Pricing
- Glass Bento
- Quote Wall
- Glass Cta
- Magnet Button
- Beam Border
- Spotlight Card
- Scratch Reveal
- 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