Code

<script src="/glass-dock.free.js" defer></script>

<glass-dock size="56" magnify="1.6" theme="light">
  <button data-label="Home" aria-current="true"><svg>…</svg></button>
  <button data-label="Search"><svg>…</svg></button>
  <a href="/messages" data-label="Messages"><svg>…</svg></a>
</glass-dock>

In context

Site navigation
App launcher, coloured tiles Pro

Install · Free Web Component

One file, no dependencies. Porcelain 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-dock.json
2. Load it and use the element
HTML
<script src="/glass-dock.free.js" defer></script>

<glass-dock size="52" magnify="1.6" theme="light">
  <button data-label="Home" aria-current="true"><svg>…</svg></button>
  <button data-label="Search"><svg>…</svg></button>
  <a href="/messages" data-label="Messages"><svg>…</svg></a>
</glass-dock>
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-dock.d.ts
declare namespace JSX {
  interface IntrinsicElements {
    'glass-dock': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & {
      size?: number | string;
      magnify?: number | string;
      theme?: 'light' | 'dark';
      elevation?: number | string;
    };
  }
}

Pro · React + TypeScript Pro

One payment of $4.99, yours forever. Use it in unlimited personal and commercial projects; no resale.

  • React component with a typed items array (buttons or links) and TypeScript types
  • Coloured tiles: a background and icon colour per item, for app launchers and brand docks
  • The vanilla Web Component, a demo page, README and license

Attributes & props

NameTypeDefaultDescription
size number (px)52Tile size at rest; the bar and gaps scale with it.
magnify number1.6How large the tile under the pointer gets. 1 turns the wave off.
theme 'light' | 'dark''light'Frosted white or smoked glass.
elevation 0..53Depth of the bar’s shadow.
items { label, icon, active, href, onClick }[]—React only. In HTML, put <button> or <a> children inside with data-label.
tile / ink ProCSS background / colour—Per-item tile background and icon colour.

The bar blurs what is behind it, so it reads best over a photo or a coloured page. Tiles are real buttons or links: Tab moves through them, and the focused tile swells like a hovered one. On touch screens the wave is off and tiles simply press. Reduced motion snaps sizes instead of easing. It uses no WebGL.

More components