Tabs

A set of layered sections of content that are displayed one at a time.

navigationinteractive
Loading preview...

Installation

Terminal
npx baseui-cn add tabs

The CLI installs styles/navigation.styles.css alongside the component. For manual installation, copy that stylesheet from the registry and keep the component import. It uses the existing semantic theme variables.

Usage

Code
import { Tabs, TabsList, TabsTrigger, TabsContent } from "@/components/ui/tabs"
Code
<Tabs defaultValue="account">
  <TabsList>
    <TabsTrigger value="account">Account</TabsTrigger>
    <TabsTrigger value="password">Password</TabsTrigger>
  </TabsList>
  <TabsContent value="account">Account settings.</TabsContent>
  <TabsContent value="password">Password settings.</TabsContent>
</Tabs>

System specimen

Navigation and disclosure together, with controlled tabs, disclosure, page selection and the existing Menubar.

Loading preview...

Examples

Basic

Standard tab navigation with a quiet neutral indicator.

Loading preview...

Line variant

Underline-style indicator for a minimal look.

Loading preview...

Vertical

Vertical tab orientation — tabs stack on the side.

Loading preview...

Vertical line

Vertical orientation with the line variant — indicator on the side.

Loading preview...

Pill style

Tab triggers styled as rounded pills.

Loading preview...

With icons

Tabs with inline SVG icons alongside labels.

Loading preview...

Disabled tab

Individual tabs can be disabled.

Loading preview...

API

TabsList

PropTypeDefaultDescription
variant"default" | "underline" | "line""default"Visual style of the tab list — neutral (default) or underline indicator

API Reference

See the Base UI Tabs documentation for the full API reference, including all props, data attributes, and CSS classes.