Xzero UI
Pro library

Glass tab barPro

A floating Liquid Glass tab bar that refracts what scrolls beneath it, with a glass lens that glides, magnifies and can be dragged between tabs, and an optional search bubble; it compacts on scroll down.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui-pro/glass-tabbar
Live · keyboard ready

When to use

When not to use

Installation

Register both Xzero UI namespaces in your project's components.json:

{
  "registries": {
    "@xzero-ui": "https://mcp.xzero.co.uk/r/{name}.json",
    "@xzero-ui-pro": "https://mcp.xzero.co.uk/r/pro/{name}.json"
  }
}
npx shadcn@4.23.0 add @xzero-ui-pro/glass-tabbar

Install xzero-foundation once, and import @/components/xzero/foundation.css in your app root. No Xzero token is used by this snapshot. For sample portraits, photos, fonts, or logos, download https://mcp.xzero.co.uk/install-assets.mjs and run node xzero-install-assets.mjs <receiving-project>.

Usage

import { GlassTabBar } from "@/components/xzero/glass-tabbar/glass-tabbar";
import { Bookmark, Compass, House, Search, UserRound } from "lucide-react";

export function AppShell() {
  const [tab, setTab] = useState("home");
  return (
    <GlassTabBar
      className="tabbar"
      value={tab}
      onValueChange={setTab}
      items={[
        { value: "home", label: "Home", icon: <House /> },
        { value: "explore", label: "Explore", icon: <Compass /> },
        { value: "saved", label: "Saved", icon: <Bookmark />, badge: 3 },
        { value: "profile", label: "Profile", icon: <UserRound /> },
      ]}
      action={{ value: "search", label: "Search", icon: <Search /> }}
    />
  );
}

API reference

GlassTabBar

A floating Liquid Glass tab bar. The bar refracts what scrolls under it, and the selected tab sits under a glass lens that glides, lifts, and magnifies as it moves and can be dragged across the tabs. An optional round action bubble sits beside it, and the bar shrinks to a compact pill of icons on scroll down.

PropTypeDefaultDescription
items (required)GlassTabBarItem[]–Tabs with value, label, icon, and an optional badge.
valuestring–Controlled active tab. A value that matches no tab, or the action, hides the lens.
defaultValuestring–Initial active tab when uncontrolled. Defaults to the first item.
onValueChange(value: string) => void–Called when a tab or the action is chosen by tap, drag, or keyboard.
actionGlassTabBarItem–A separate round glass tab beside the bar, such as search. It takes part in selection and keyboard order like any tab.
compactboolean–Controlled compact state.
defaultCompactbooleanfalseInitial compact state when uncontrolled.
onCompactChange(compact: boolean) => void–Called when the bar shrinks or grows.
scrollRefRefObject<HTMLElement | null>–Scroll container to watch. Leave it out to watch the window.
collapseOnScrollbooleantrueShrink on scroll down and grow on scroll up.
labelstring"Tabs"Accessible name of the navigation and its tab list.
classNamestring–Extra class on the nav. Position the bar here, usually fixed or absolute at the bottom.
styleCSSProperties–Inline style on the nav.

GlassTabBarItem

One tab, or the action.

PropTypeDefaultDescription
value (required)string–Unique value.
label (required)string–Visible label and accessible name. The action shows only its icon and uses the label as its name.
icon (required)ReactNode–Icon at 22px; lucide icons are sized automatically.
badgenumber | string–Count shown as an accent badge on the icon. 0 or empty hides it.

Keyboard interactions

KeysAction
TabMoves focus to the selected tab; the tab list is one stop.
Arrow left / Arrow rightMoves to and selects the previous or next tab, including the action, wrapping around.
Home / EndSelects the first tab or the last one.
Enter / SpaceSelects the focused tab and grows the bar if it is compact.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Also in glass

Guidance for AI tools

Glass tab bar: A floating Liquid Glass tab bar that refracts what scrolls beneath it, with a glass lens that glides, magnifies and can be dragged between tabs, and an optional search bubble; it compacts on scroll down. Follow the declared prop types and do not invent props. Keep keyboard access, reduced motion support, and both light and dark themes intact when adapting it.

Full library index: https://ui.xzero.co.uk/llms.txt

Browse all components