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,collapsed/onCollapsedChange,brand,footer, your own icon nodes) 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 rows. data-icon names a built-in icon (home, inbox, chart, folder, users, settings, file, calendar, card, bell, search, star, layers, help) — or put your own <svg> inside the link; data-badge adds a count; data-section starts a heading that carries on to the rows after it; data-value sets what change reports (default: the href). |
| <div data-label> | children | — | A group that expands: any element that holds links. data-label is its name, data-icon its icon, data-open starts it expanded. The group that holds the current page opens by itself. |
| value | string | the aria-current link | The current row — its data-value or href. It gets aria-current="page". Fires a cancelable change with detail.value and detail.href when the user picks a row. |
| collapsed | boolean | off | Icon rail: labels fade, badges become dots, names show as tooltips on hover and focus. Also el.collapse(), el.expand() and el.toggle(). Fires toggle with detail.collapsed. |
| brand | string | — | Name at the top. For a logo, add a child with data-brand; a child with data-footer sits at the bottom (put the avatar first — it stays visible in the rail). |
| width | number (px) | CSS width | 248 | Width when expanded. The rail is 1.4 × the row height plus the padding. |
| height | number (px) | CSS height | auto | Fixed height (100% for a full-height shell); the list scrolls inside. Without it the sidebar is as tall as its rows. |
| size | number (px) | 40 | Row height; the type, the icons, the corners and the rail scale with it. |
| theme | 'light' | 'dark' | 'light' | White or dark glass. |
| sound | boolean | off | A glass tick on a pick and a clink as the sidebar folds. Also on for everything inside an element with data-ui-sound="on". |
| tint Pro | 'aurora' | 'sunset' | 'mint' | 'mono' | object | 'aurora' | Colours of the light on the current row and along the top edge, or a custom tint. Free build ships Aurora only. |
A real nav of links: every row is a tab stop, and Up / Down, Home and End also walk the rows; Right opens a group or steps into it, Left closes it or goes back to its parent. The highlight is one element for the whole list — it follows the pointer and keyboard focus and returns to the current page when you leave. In the rail the labels stay in the accessibility tree, so screen readers still read them; a group pressed in the rail brings the sidebar back first. change is cancelable: call preventDefault() to stop the page load and route it yourself — the mark moves either way. The rows are read once, when the element connects. The sidebar is a block with its own width, so put it in a flex row next to your content; it does not overlay the page. All CSS, no WebGL; the backdrop blur is the only costly part.
More components
- Glass Nav
- Pearl Tabs
- Glass Command
- Glass Tabbar
- 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