Search documentation

Search pages, components, blocks, styles and colours.

Get started
Skip to content

Tabs

PreviousNext

A set of layered sections of content—known as tab panels—that are displayed one at a time.

Overview
View your key metrics and recent project activity. Track progress across all your active projects.
You have 12 active projects and 3 pending tasks.

Installation

bunx --bun fabricator-ui@latest add tabs

Usage

import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"
<Tabs defaultValue="account" className="w-[400px]">
  <TabsList>
    <TabsTrigger value="account">Account</TabsTrigger>
    <TabsTrigger value="password">Password</TabsTrigger>
  </TabsList>
  <TabsContent value="account">Make changes to your account here.</TabsContent>
  <TabsContent value="password">Change your password here.</TabsContent>
</Tabs>

Composition

Use the following composition to build Tabs:

Tabs
├── TabsList
│   ├── TabsTrigger
│   └── TabsTrigger
├── TabsContent
└── TabsContent

Subtle

Use variant="subtle" on TabsList for a compact row without a track. Only the active tab shows its label; the others show their icon, so give every trigger an icon and a text label.

The rendered result.

Vertical

Use orientation="vertical" for vertical tabs.

Disabled

Icons

API Reference

See the Base UI Tabs documentation.

TabsList

PropTypeDefault
variant"default" | "subtle""default"

variant="line" is still accepted, so existing code keeps compiling, and renders as "default".

Accessibility

  • Keyboard behaviour and roles come from the primitive: arrow keys move between tabs, and orientation="vertical" switches them to up and down.
  • In a subtle list, the labels of inactive tabs are hidden visually but stay in each tab's accessible name.
  • The active tab never changes weight or size, so the row never shifts when the selection moves.