Browse docsTabs

Navigation

Glass Tabs

Tabs on a glass pill, with one indicator that moves to the selected tab.

Preview

A glass lozenge slides to the selected tab.

Demos ready. Update 0.

Installation

For React 19+ apps with Tailwind CSS 4.

npx shadcn@4.14.1 add @glassyui/glass-tabs

Adds 13 files to components/glassyui and installs @radix-ui/react-tabs and clsx.

Usage

Usage

import { GlassTabs, GlassTabsContent, GlassTabsList, GlassTabsTrigger } from "@/components/glassyui/glass-tabs";

export function TabsDemo() {
  return (
    <GlassTabs defaultValue="preview">
      <GlassTabsList>
        <GlassTabsTrigger value="preview">Preview</GlassTabsTrigger>
        <GlassTabsTrigger value="code">Code</GlassTabsTrigger>
      </GlassTabsList>
      <GlassTabsContent value="preview">Glass preview</GlassTabsContent>
      <GlassTabsContent value="code">Copy-ready code</GlassTabsContent>
    </GlassTabs>
  );
}

Examples

Default tab

<GlassTabs defaultValue="preview">...</GlassTabs>

API reference

GlassTabs

PropTypeDefaultDescription
value / defaultValuestringNoneControlled or uncontrolled selected tab, matching a trigger's value.
onValueChange(value: string) => voidNoneCalled with the newly selected tab's value.
orientation'horizontal' | 'vertical''horizontal'Sets which arrow keys move between triggers.

Also accepts Radix Tabs.Root props.

GlassTabsList

The glass pill that holds the triggers and the moving indicator.

PropTypeDefaultDescription
classNamestringNoneApplies to the glass pill.

Also accepts Radix Tabs.List props.

GlassTabsTrigger

PropTypeDefaultDescription
valueRequiredstringNoneTies the trigger to the GlassTabsContent with the same value.

Also accepts Radix Tabs.Trigger props.

GlassTabsContent

The tab's panel, on a glass card.

PropTypeDefaultDescription
valueRequiredstringNoneShown when the trigger with the same value is selected.
classNamestringNoneApplies to the glass card.

Also accepts Radix Tabs.Content props.