docs/components/tabs
Sections
Components
Utilities
Forms
Hooks
Copy Markdown
A tabs for navigating between content.
PreviewCode
ProfileSettingsSecurity
Profile
Manage your profile information
View you shared information here, update you profile name, picture and email.
CLIManual
pnpmbunnpmyarn
pnpm dlx shadcn@latest add @shark/tabs
Tabs
├── TabsList
│ └── TabsTrigger
└── TabsContent
import {
Tabs,
TabsList,
TabsTrigger,
TabsContent
} from "@/components/ui/tabs";
<Tabs>
<TabsList>
<TabsTrigger value="1">Tab 1</TabsTrigger>
<TabsTrigger value="2">Tab 2</TabsTrigger>
</TabsList>
<TabsContent value="1">Tab 1 content</TabsContent>
<TabsContent value="2">Tab 2 content</TabsContent>
</Tabs>
Use value and onValueChange to control the active tab programmatically.
PreviewCode
ProfileSettingsSecurity
Manage your profile information and preferences.
Go to ProfileGo to SettingsGo to Security
PreviewCode
ProfileSettingsSecurity
Content 1
PreviewCode
ProfileSettingsSecurity
Content 1
Use the orientation prop on Tabs to lay out tabs horizontally or vertically.
PreviewCode
Tab 1Tab 2Tab 3
Content 1
PreviewCode
Tab 1Tab 2Tab 3
Content 1
Disable individual tabs with the disabled prop on TabsTrigger. Disabled tabs are not focusable or selectable.
PreviewCode
ProfileSettings
Profile content
Combine orientation="vertical" on Tabs with variant="underline" on TabsList.
PreviewCode
Tab 1Tab 2Tab 3
Content 1
PreviewCode
ProfileSettingsSecurity
Profile content
Root element. Manages tab state and layout.
| Prop | Type | Default |
|---|---|---|
value | string | - |
defaultValue | string | - |
onValueChange | (details: ValueChangeDetails) => void | - |
orientation | `"horizontal" | "vertical"` |
className | string | - |
Container for tab triggers and the selection indicator.
| Prop | Type | Default |
|---|---|---|
variant | `"default" | "underline"` |
className | string | - |
Button that selects a tab. Must have a value matching a TabsContent panel.
| Prop | Type | Default |
|---|---|---|
value | string | required |
disabled | boolean | false |
className | string | - |
Panel shown when its tab is selected. Must have a value matching a TabsTrigger.
| Prop | Type | Default |
|---|---|---|
value | string | required |
className | string | - |
For a complete list of props, see the Ark UI documentation.
[
Previous page
Table ](/docs/components/table)[
Next page
Tags Input ](/docs/components/tags-input)
On This Page
InstallationAnatomyUsageControlledVariantDefaultUnderlineOrientationHorizontalVerticalStatesDisabledExamplesVertical with underlineWith iconsAPI ReferenceTabsTabsListTabsTriggerTabsContent