Skip to content

Tabs

Navigation

Tabbed interface for switching between content panels. Supports controlled and uncontrolled modes.

Two panelsDisabled tab
Open preview

Responsive viewport — resize the window to explore. Direction and density apply only to this preview. Theme applies to the docs too.

Usage

Use TabsList and TabsTrigger to switch between related TabsContent panels. Set defaultValue for an uncontrolled group or value and onValueChange for controlled state.

Import
import {
  Tabs,
  TabsList,
  TabsTrigger,
  TabsContent,
} from "@dashboardpack/core/components/ui/tabs";

Available in the included @dashboardpack/core package. Copy the complete example from Source code for all imports and state. Add "use client" when using hooks or event handlers. See installation and theming for project setup.

API reference

Common props and defaults. Slot-specific props are named below; native elements also accept their standard HTML attributes. The component TypeScript definitions are the complete type reference.

Tabs props
PropType / DefaultDescription
value / defaultValuestring

Default: —

Controlled or initial active tab.
onValueChange(value: string) => void

Default: —

Handle active-tab changes.
orientationhorizontal | vertical

Default: horizontal

Keyboard navigation direction.
activationModeautomatic | manual

Default: automatic

Whether focusing a tab activates it.
disabled (TabsTrigger)boolean

Default: false

Prevent tab activation.

Build with these too