GitHub

Tabs

Accessible tabbed views with keyboard navigation and glassmorphism styling.

Overview

Review the workspace summary and key metrics.

Everything stays in a compact, stable panel.

Tabs organizes related content into a compact, keyboard-friendly interface. It is built on Radix UI, so it ships with the expected WAI-ARIA tab pattern, roving focus, and arrow-key navigation while matching the glassmorphism language used across the system.

Use the variant prop on TabsList to adjust container emphasis and the size prop on TabsTrigger to match the density of the surrounding UI.

Installation

npx @glass-ui-kit/cli add tabs

Usage

import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"
export default function App() {
return (
<Tabs defaultValue="overview" className="w-full max-w-xl">
<TabsList aria-label="Project views">
<TabsTrigger value="overview">Overview</TabsTrigger>
<TabsTrigger value="activity">Activity</TabsTrigger>
<TabsTrigger value="members">Members</TabsTrigger>
</TabsList>
<TabsContent value="overview">Overview content.</TabsContent>
<TabsContent value="activity">Activity content.</TabsContent>
<TabsContent value="members">Members content.</TabsContent>
</Tabs>
)
}

Examples

Sizes

Use the size prop on TabsTrigger to match nearby control density. md is the default and is sized to align visually with Button md.

Overview
Overview
Overview

Variants

Use the variant prop on TabsList to adjust the glass depth without changing the component structure.

Overview
Overview
Overview

Vertical

Set orientation="vertical" on the root and give the layout a two-column wrapper when your labels work better as a side rail.

Overview

Controlled

Use value and onValueChange when the active tab needs to stay in sync with surrounding state.

import { useState } from "react"
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"
export default function ControlledTabs() {
const [value, setValue] = useState("overview")
return (
<Tabs value={value} onValueChange={setValue}>
<TabsList aria-label="Project views">
<TabsTrigger value="overview">Overview</TabsTrigger>
<TabsTrigger value="activity">Activity</TabsTrigger>
</TabsList>
<TabsContent value="overview">Overview content.</TabsContent>
<TabsContent value="activity">Activity content.</TabsContent>
</Tabs>
)
}

Styling

Tabs follows a prop-first API. Reach for variant on TabsList and size on TabsTrigger first. Use className as an escape hatch for layout-specific spacing like vertical side rails or custom panel widths.

/* List variants */
<TabsList variant="default" />
<TabsList variant="soft" />
<TabsList variant="strong" />
/* Trigger sizes */
<TabsTrigger size="sm" value="overview" />
<TabsTrigger size="md" value="overview" />
<TabsTrigger size="lg" value="overview" />
/* Escape hatches */
<Tabs className="max-w-2xl" />
<TabsList className="w-full" />
<TabsContent className="mt-0" />

API Reference

Tabs

Accepts all Radix Tabs.Root props.

PropType
defaultValuestring
valuestring
onValueChange(value: string) => void
orientation"horizontal" | "vertical"
dir"ltr" | "rtl"
activationMode"automatic" | "manual"
classNamestring

TabsList

PropType
variant"default" | "soft" | "strong"
loopboolean
aria-labelstring
classNamestring

TabsTrigger

PropType
valuestring (required)
size"sm" | "md" | "lg"
disabledboolean
classNamestring

TabsContent

PropType
valuestring (required)
forceMountboolean
classNamestring