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 (
items,value/onChange,action/onAction) with TypeScript types and the full source - 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 |
|---|---|---|---|
| <button value> | children | — | The tabs, three to five. The text is the label; data-icon names a built-in icon (home, search, compass, heart, bookmark, bell, chat, user, bag, card, calendar, chart, grid, plus) or put your own <svg> inside. data-badge="3" adds a count, an empty data-badge a dot. |
| data-action | attribute on one child | — | Turns that button into the round centre action that sits proud of the bar. Give it an aria-label; data-icon defaults to plus. Fires action when pressed. Use an even number of tabs so it lands in the middle. |
| value | string | first tab | The chosen tab. Attribute and property; fires change with detail.value when the user picks another. |
| labels | 'active' | 'always' | 'none' | 'active' | Show the label of the chosen tab only, of every tab, or icons alone (the labels stay for screen readers). |
| size | number (px) | 64 | Bar height; icons, labels, the lens and the centre action scale with it. |
| width | number (px) | CSS width | 360 | Max width of the bar; it is centred and never wider than its parent. |
| theme | 'light' | 'dark' | 'light' | White or dark glass. |
| sound | boolean | off | A glass clink on each change, a little higher for tabs further right. Also on for everything inside an element with data-ui-sound="on". |
| tint Pro | 'aurora' | 'sunset' | 'mint' | 'mono' | object | 'aurora' | Colours of the light under the lens and of the chosen icon, or a custom tint. Free build ships Aurora only. |
The bar does not position itself: put it in your own fixed wrapper at the bottom of the screen and add env(safe-area-inset-bottom) there. It is a role="tablist" with one tab stop — the arrow keys, Home and End move the choice, and the centre action is a separate button after it. The lens is measured from the tabs, so it follows any width and re-settles without animation when the bar is resized. The tabs are read once, when the element connects. All CSS and a few lines of script, no WebGL; the backdrop blur is the only costly part, and with reduced motion the lens simply appears under the new tab.
More components
- Glass Nav
- Pearl Tabs
- Glass Command
- Glass Sidebar
- Pearl Pagination
- Pearl Breadcrumb
- 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
- 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 Menu
- Pearl Pricing
- Glass Bento
- Quote Wall
- Glass Cta
- Magnet Button
- Beam Border
- Spotlight Card
- Scratch Reveal
- 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