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 (
links,brand,cta,open/onOpenChange,onNavigate) 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 |
|---|---|---|---|
| <a href> | children | — | The links. A plain link sits in the bar (and in the menu when the bar is narrow); aria-current="page" marks the current page; data-label overrides its text. |
| data-menu | attribute on a link | — | Menu only: the link never shows in the bar. With data-group="Company" it sits under that heading, and data-desc adds a quieter second line. |
| data-cta | attribute on a link | — | The one filled button on the right. In a narrow bar it moves to the bottom of the menu. |
| brand | string | — | Name on the left. For a logo or a home link, add a child with data-brand instead (an <a>, an <img>, anything). |
| open | boolean | off | The menu is open. Also el.show(), el.hide() and el.toggle(). Fires toggle with detail.open when the user opens or closes it. |
| width | number (px) | CSS width | 760 | Max width of the capsule; it is centred and never wider than its parent. Below 560px of real width the bar links hide and only the menu remains. |
| size | number (px) | 56 | Bar height; the type, the pill and the buttons scale with it. |
| sticky | boolean | off | position: sticky at the top of the scroller (offset --gn-top, 12px). Without it the header stays in the normal flow. |
| theme | 'light' | 'dark' | 'light' | White or dark glass. |
| sound | boolean | off | A glass clink as the menu opens and closes. Also on for everything inside an element with data-ui-sound="on". |
| tint Pro | 'aurora' | 'sunset' | 'mint' | 'mono' | object | 'aurora' | Colours of the light along the top edge and the current-page mark, or a custom tint. Free build ships Aurora only. |
The header takes one bar of height in the layout; the open menu grows over whatever is below it, so nothing on the page jumps. The menu button carries aria-expanded and aria-controls; the closed menu is inert. Opened from the keyboard, focus steps into the menu, the arrows, Home and End walk it, and Escape, Tab-ing away or a click outside closes it and hands focus back. Clicking a link fires a cancelable navigate event with detail.href and detail.label — call preventDefault() to route it yourself. The compact layout is measured on the element, not the viewport, so it also collapses inside a sidebar or a preview frame. The links are read once, when the element connects. All CSS, no WebGL; the backdrop blur is the only costly part.
More components
- Pearl Tabs
- Glass Command
- Glass Tabbar
- 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