Good morning, Mira
Two trips coming up
Lisbon12–16 May · 3 nights
Kyoto2–9 June · 7 nights
OsloNot booked yet
Lisbon12–16 May · 3 nights
Kyoto2–9 June · 7 nights

Code

<!-- glass-tabbar.free.js: download it from the Install section below and host it with your site -->
<script src="/glass-tabbar.free.js" defer></script>

<glass-tabbar value="home" size="64" aria-label="Main" theme="light">
  <button data-icon="home" value="home">Home</button>
  <button data-icon="compass" value="explore">Explore</button>
  <button data-icon="heart" value="saved">Saved</button>
  <button data-icon="chat" value="inbox" data-badge="3">Inbox</button>
  <button data-icon="user" value="profile">Profile</button>
</glass-tabbar>

<script>
  const bar = document.querySelector('glass-tabbar');
  bar.addEventListener('change', (e) => showScreen(e.detail.value));
</script>

In context

With a centre action that sits proud of the bar
Sunset, three tabs, labels always on Pro

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.

1. Install with one command — or download the file
shadcn CLI · React
npx shadcn@latest add https://www.ui-design.co/r/glass-tabbar.json
2. Load it and use the element
HTML
<!-- glass-tabbar.free.js: download it from the Install section below and host it with your site -->
<script src="/glass-tabbar.free.js" defer></script>

<glass-tabbar value="home" size="64" aria-label="Main" theme="light">
  <button data-icon="home" value="home">Home</button>
  <button data-icon="compass" value="explore">Explore</button>
  <button data-icon="heart" value="saved">Saved</button>
  <button data-icon="chat" value="inbox" data-badge="3">Inbox</button>
  <button data-icon="user" value="profile">Profile</button>
</glass-tabbar>

<script>
  const bar = document.querySelector('glass-tabbar');
  bar.addEventListener('change', (e) => showScreen(e.detail.value));
</script>
3. React + TypeScript (optional)

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:

TypeScript
// glass-tabbar.d.ts
declare namespace JSX {
  interface IntrinsicElements {
    'glass-tabbar': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & {
      value?: string;
      labels?: 'active' | 'always' | 'none';
      size?: number | string;
      width?: number | string;
      theme?: 'light' | 'dark';
      sound?: boolean | '';
    };
  }
}

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

NameTypeDefaultDescription
<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 stringfirst tabThe 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)64Bar height; icons, labels, the lens and the centre action scale with it.
width number (px) | CSS width360Max width of the bar; it is centred and never wider than its parent.
theme 'light' | 'dark''light'White or dark glass.
sound booleanoffA 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