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, an
asprop for the tag, and a ref withsetProgress()andreplay() - Sunset, Mint and Mono tints, 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 |
|---|---|---|---|
| content | text + inline tags | — | The text is the element’s content. Inline tags such as <em>, <a> and <br> are kept as they are. |
| mode | 'scrub' | 'once' | 'scrub' | scrub ties the light to the scroll position, forwards and back. once plays it through by time when the text enters view: words rise out of a blur, one after another. |
| start | number 0..1 | 0.85 | Where in the viewport the reveal begins, as a share of its height from the top: it starts when the top of the text crosses this line. |
| end | number 0..1 | 0.35 | Where it is complete: the last word is lit when the bottom of the text crosses this line. |
| by | 'word' | 'line' | 'char' | 'word' | What the light steps through. Lines are measured from the real layout and re-measured on resize. |
| progress | number 0..1 | — | Pins the reveal at a fixed point instead of following scroll or time — drive it from your own timeline. Also el.setProgress(p); null hands control back. |
| scroller | CSS selector | "window" | auto | The scrolling box to follow. By default the nearest scrollable ancestor, else the window. |
| theme | 'light' | 'dark' | 'light' | Ink colour: dark ink for light pages, light ink for dark ones. |
| tint Pro | 'aurora' | 'sunset' | 'mint' | 'mono' | object | 'aurora' | Colours of the words at the front of the light, or a custom tint. Free build ships Aurora only. |
It inherits font, size and line height from where you put it, so wrap it in your own heading or paragraph. Screen readers get the whole text once, as a label, and the split words are hidden from them; when the text contains links, the words stay readable instead so the links keep working. It fires reveal when the last word is lit, and replay() restarts mode="once". One passive scroll listener and one animation frame drive it, and it idles while off-screen. With reduced motion the text is simply fully lit. No WebGL, no dependencies.
More components
- Roll Counter
- Glass Marquee
- 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
- 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
- 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