--- title: Tabs description: A component for toggling between related panels on the same page. links: doc: https://base-ui.com/react/components/tabs#api-reference --- ## Installation CLI Manual ```bash npx shadcn@latest add @coss/tabs ``` The CLI installs the shared `@coss/segmented-control` registry dependency automatically. Install the following dependencies: ```bash npm install @base-ui/react class-variance-authority ``` Copy the shared segmented control styling into your project. Copy and paste the Tabs component into your project. Update the import paths to match your project setup. ## Usage ```tsx import { Tabs, TabsList, TabsPanel, TabsTab } from "@/components/ui/tabs" ``` ```tsx Tab 1 Tab 2 Tab 3 Tab 1 content Tab 2 content Tab 3 content ``` ## API Reference ### Tabs Root component. Styled wrapper for `Tabs.Root` from Base UI. ### TabsList Container for tab triggers. Styled wrapper for `Tabs.List` from Base UI. | Prop | Type | Default | Description | | --------- | -------------------------- | ----------- | ----------------------------------- | | `size` | `"sm" \| "default" \| "lg"` | `"default"` | Controls the size of all tab items. | | `variant` | `"default" \| "underline"` | `"default"` | Controls the tabs styling. | ### TabsTab Individual tab trigger. Styled wrapper for `Tabs.Tab` from Base UI. ### TabsPanel Content panel for each tab. Styled wrapper for `Tabs.Panel` from Base UI. ### TabsIndicator Visual indicator for the active tab. Styled wrapper for `Tabs.Indicator` from Base UI. ## Examples For guidance on choosing between Tabs, Radio Group, Toggle Group, and navigation links, see the [Segmented Control](/ui/docs/components/segmented-control) pattern. Tabs use the same optical sizing as segmented controls. The default surface is slightly taller than a Button of the same size so its inset active indicator remains visually balanced alongside adjacent controls. ### Small ### Large ### Underline Variant ### Vertical Orientation ### Underline with Vertical Orientation