Primitive / Moleculestable
Tabs
Tabbed interface for switching between grouped content panels.
@glinui/uiComponent: tabs
Installation
Install from the package for shared ownership or from the registry for copy-paste control.
Package Manager
pnpm add @glinui/ui @glinui/tokensRegistry
pnpm dlx @glinui/cli@latest add tabsUsage
Basic
Account settings.
TSX
1import { Tabs, TabsList, TabsTrigger, TabsContent } from "@glinui/ui"23export function Demo() {4 return (5 <Tabs defaultValue="account">6 <TabsList>7 <TabsTrigger value="account">Account</TabsTrigger>8 <TabsTrigger value="password">Password</TabsTrigger>9 </TabsList>10 <TabsContent value="account">11 <p className="text-sm text-neutral-600 dark:text-neutral-400">Account settings.</p>12 </TabsContent>13 <TabsContent value="password">14 <p className="text-sm text-neutral-600 dark:text-neutral-400">Password settings.</p>15 </TabsContent>16 </Tabs>17 )18}
Glass Variant
Glass tab content.
TSX
1import { Tabs, TabsList, TabsTrigger, TabsContent } from "@glinui/ui"23export function Demo() {4 return (5 <Tabs defaultValue="first">6 <TabsList variant="glass">7 <TabsTrigger value="first" variant="glass">First</TabsTrigger>8 <TabsTrigger value="second" variant="glass">Second</TabsTrigger>9 </TabsList>10 <TabsContent value="first" variant="glass">Glass tab content.</TabsContent>11 <TabsContent value="second" variant="glass">Second panel.</TabsContent>12 </Tabs>13 )14}
Liquid + Matte Variants
Liquid tab surface.
Matte tab surface.
TSX
1import { Tabs, TabsList, TabsTrigger, TabsContent } from "@glinui/ui"23export function Demo() {4 return (5 <div className="grid gap-4 md:grid-cols-2">6 <Tabs defaultValue="liquid-1">7 <TabsList variant="liquid">8 <TabsTrigger value="liquid-1" variant="liquid">Liquid A</TabsTrigger>9 <TabsTrigger value="liquid-2" variant="liquid">Liquid B</TabsTrigger>10 </TabsList>11 <TabsContent value="liquid-1" variant="liquid">Liquid tab surface.</TabsContent>12 <TabsContent value="liquid-2" variant="liquid">Second liquid panel.</TabsContent>13 </Tabs>14 <Tabs defaultValue="matte-1">15 <TabsList variant="matte">16 <TabsTrigger value="matte-1" variant="matte">Matte A</TabsTrigger>17 <TabsTrigger value="matte-2" variant="matte">Matte B</TabsTrigger>18 </TabsList>19 <TabsContent value="matte-1" variant="matte">Matte tab surface.</TabsContent>20 <TabsContent value="matte-2" variant="matte">Second matte panel.</TabsContent>21 </Tabs>22 </div>23 )24}
Accessibility
- Built on Radix Tabs with full WAI-ARIA.
- Content is associated via `aria-controls`.
Keyboard Interactions
| Key | Action |
|---|---|
| Arrow Left / Right | Navigate between tab triggers. |
| Enter / Space | Select the focused tab. |
ARIA Attributes
- `role="tablist"` on list
- `role="tab"` on triggers
- `role="tabpanel"` on content
- `aria-selected`
- `aria-controls`
Reduced Motion
Active indicator transitions respect `prefers-reduced-motion`.
Affected properties
transformopacityAPI Reference
Tabs
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
defaultValue | string | - | - | Initially active tab. |
value | string | - | - | Controlled active tab. |
onValueChange | (value: string) => void | - | - | Tab change handler. |
orientation | "horizontal" | "vertical" | - | horizontal | Layout direction of the tab list. |
size | "sm" | "md" | "lg" | No | "md" | Variant option from tabsContentVariants. |
variant | "default" | "glass" | "outline" | "ghost" | "liquid" | "matte" | No | "default" | Variant option from tabsContentVariants. |
TabsList
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
variant | "default" | "glass" | "outline" | "ghost" | "liquid" | "matte" | No | default | Visual treatment. |
size | "sm" | "md" | "lg" | No | md | Density scale. |
TabsTrigger
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
value | string | - | - | Unique value identifying this tab. |
variant | "default" | "glass" | "outline" | "ghost" | "liquid" | "matte" | No | default | Visual treatment. |
size | "sm" | "md" | "lg" | No | md | Density scale. |
disabled | boolean | - | false | Prevents interaction. |
TabsContent
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
value | string | - | - | Value matching the associated trigger. |
variant | "default" | "glass" | "outline" | "ghost" | "liquid" | "matte" | No | default | Visual treatment. |
size | "sm" | "md" | "lg" | No | "md" | Variant option from tabsContentVariants. |
Source
Import directly from the package or browse the source on GitHub. Click any file to view it.
Generated API Snapshot
Beta
Generated API Snapshot
BetaAuto-extracted from TypeScript source in packages/ui/src/components/tabs.tsx. This section is in beta and may lag behind hand-curated docs. Regenerate with pnpm --filter @glinui/docs api:generate.
Generated: 2026-02-19T17:59:28.468Z · Full index: /docs/api-metadata
Primary Props Type
TabsProps
TabsContentProps
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
size | "sm" | "md" | "lg" | No | "md" | Variant option from tabsContentVariants. |
variant | "default" | "glass" | "outline" | "ghost" | "liquid" | "matte" | No | "default" | Variant option from tabsContentVariants. |
TabsListProps
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
size | "sm" | "md" | "lg" | No | "md" | Variant option from tabsListVariants. |
variant | "default" | "glass" | "outline" | "ghost" | "liquid" | "matte" | No | "default" | Variant option from tabsListVariants. |
TabsProps
No explicit fields extracted for this props type.
TabsTriggerProps
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
size | "sm" | "md" | "lg" | No | "md" | Variant option from tabsTriggerVariants. |
variant | "default" | "glass" | "outline" | "ghost" | "liquid" | "matte" | No | "default" | Variant option from tabsTriggerVariants. |