Xzero UI
Pro library

Liquid tab barPro

Tabs with a lens selection that slides between them, swaps labels cleanly, and fills in icons as it passes.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui-pro/liquid-tab-bar
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/liquid-tab-bar

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 { LiquidTabBar, liquidPanelId, liquidTabId } from "@/components/xzero/liquid-tab-bar/liquid-tab-bar";
import { Home, Library, Radio } from "lucide-react";

export function Sections() {
  const [tab, setTab] = useState("home");
  return (
    <>
      <LiquidTabBar id="nav" value={tab} onValueChange={setTab} tabs={[
        { value: "home", label: "Home", icon: <Home /> },
        { value: "radio", label: "Radio", icon: <Radio />, badge: 2, badgeLabel: "2 new" },
        { value: "library", label: "Library", icon: <Library /> },
      ]} />
      <section id={liquidPanelId("nav", tab)} role="tabpanel" aria-labelledby={liquidTabId("nav", tab)}>{/* ... */}</section>
    </>
  );
}

API reference

LiquidTabBar

Horizontal navigation for a handful of peer sections. The selection is a lens that slides to the new tab on the morph spring and redraws what passes under it inverted, so outline icons fill in.

PropTypeDefaultDescription
tabs (required){ value: string; label: string; icon: ReactNode; activeIcon?: ReactNode; badge?: number; badgeLabel?: string }[]–Tabs in order. activeIcon is drawn inside the lens (defaults to icon filled in); badge is a rolling count and badgeLabel what screen readers hear with it.
value (required)string–Selected tab value.
onValueChange (required)(value: string) => void–Called when a tab is chosen by tap, drag, or keyboard.
labels"active" | "always" | "none""active"Which tabs show their label: the selected one, every tab, or none.
labelstring"Sections"Accessible name of the tab list.
idstring–Base id for tab and panel ids. Defaults to a generated id.
classNamestring–Extra class on the tab list.

liquidTabId / liquidPanelId

Helpers that return a tab's id and the panel id its aria-controls points at, so panels can be wired up.

PropTypeDefaultDescription
id (required)string–The base id passed to LiquidTabBar.
value (required)string–The tab value.

Keyboard interactions

KeysAction
ArrowLeft / ArrowRightSelects the previous or next tab and moves focus to it, wrapping at the ends.
Home / EndSelects the first or last tab.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Also in docks and tabs

Guidance for AI tools

Liquid tab bar: Tabs with a lens selection that slides between them, swaps labels cleanly, and fills in icons as it passes. 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