Skip to content
Drivn

Tabs

Composable tab navigation with dot notation and panel content.

Preview

Manage your account settings and preferences.

Installation

npx drivn add tabs

Usage

1import { Tabs } from "@/components/ui/tabs"
2
3export default function Page() {
4 return (
5 <Tabs defaultValue="overview">
6 <Tabs.List>
7 <Tabs.Tab value="overview">Overview</Tabs.Tab>
8 <Tabs.Tab value="usage">Usage</Tabs.Tab>
9 <Tabs.Tab value="api">API</Tabs.Tab>
10 </Tabs.List>
11 <Tabs.Panel value="overview">
12 Overview content here.
13 </Tabs.Panel>
14 <Tabs.Panel value="usage">
15 Usage content here.
16 </Tabs.Panel>
17 <Tabs.Panel value="api">
18 API content here.
19 </Tabs.Panel>
20 </Tabs>
21 )
22}

API Reference

Tabs

PropTypeDefaultDescription
defaultValuestring—Initial active tab value for uncontrolled mode
valuestring—Controlled active tab value
onChange(value: string) => void—Callback fired when the active tab changes
classNamestring—Additional CSS classes to apply
childrenReactNode—Tabs sub-components (List, Tab, Panel)

Tabs.Tab

PropTypeDefaultDescription
valuestring—Unique value identifying this tab
childrenReactNode—Tab label content

Tabs.Panel

PropTypeDefaultDescription
valuestring—Value matching the corresponding Tab
childrenReactNode—Panel content displayed when tab is active