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
- Ribbon variant: one continuous band of light instead of bars
- Live audio:
micfor the microphone,attach()for your speech output or any audio node - Sunset, Mint and Mono tints, plus custom three-colour tints
- The vanilla Web Component with everything above, a demo page, README and license
Attributes & props
| Name | Type | Default | Description |
|---|---|---|---|
| state | 'idle' | 'listening' | 'thinking' | 'speaking' | 'idle' | Idle is a slow travelling breath; listening rises from the middle; thinking sweeps a scanner across the row; speaking is the full wave. States blend, they never cut. |
| level | 0..1 | built-in pattern | Loudness for listening and speaking. Leave it out and the wave moves in a speech-like pattern of its own. |
| bars | 5..64 | 24 | How many bars. The capsule grows with the count unless you give it a CSS width, in which case the bars spread to fit. |
| size | number (px) | 56 | Height of the capsule; everything inside scales with it. |
| surface | 'porcelain' | 'glass' | 'porcelain' | Porcelain for plain pages; glass blurs whatever is behind it, so give it a photo or a gradient. |
| theme | 'light' | 'dark' | 'light' | Capsule, well and bar colours for light or dark pages. |
| label | string | 'Voice activity' | Accessible name; the current state is appended for screen readers. |
| speed | number | 1 | Speed of the built-in motion. 0 freezes it. |
| variant Pro | 'bars' | 'ribbon' | 'bars' | Ribbon draws the same springs as three twisting bands of light. Free build draws bars. |
| tint Pro | 'aurora' | 'sunset' | 'mint' | 'mono' | 'aurora' | Colours of the wave and of the light it throws under the capsule. Free build ships Aurora only. |
| mic Pro | boolean | off | Makes the capsule a button: a click opens the microphone and the bars follow the voice band of your input; another click closes it. Nothing is requested on load. Fires micchange (detail.on) and micerror. |
| attach(source) Pro | method | Follow a live source instead of level: an AnalyserNode, any AudioNode (your speech output) or a MediaStream. detach() lets go; startMic() / stopMic() do what the click does. |
The bars are springs with two stiffnesses: stiff on the way up, soft on the way down, so a loud syllable lands at once and then drains away. That asymmetry is what makes it read as a voice rather than an equaliser. With live audio the middle bars take the low voice frequencies and the edges the high ones. Without mic the capsule is a picture for assistive tech (role="img", with the state in its name); with it, a button with aria-pressed. It is drawn on a 2D canvas, pauses off-screen and in hidden tabs, and under reduced motion shows one still frame per state. Pair it with Plasma Orb: the same four states, the same tints.
More components
- Stream Text
- Plasma Orb
- Plush Buddy
- Gummy Agent
- Mercury Orb
- Prompt Input
- Voice Orb
- Alien Face
- Tide Slide
- Pearl Code
- Ink Sphere
- Frost Card
- Holo Card
- 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
- Mesh Gradient
- Silk Waves
- Dot Field
- 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
- Aurora Ring
- Glass Toggle
- Firefly Button
- Pearl Button
- Pearl Loader
- Prism Button
- Liquid Carousel
- Orbit Carousel
- Deck Carousel