Tabs

A set of layered sections of content that display one panel at a time.

navigation
tabs
sections
content

Preview

Account settings go here.

Variants

Simple tabs with basic content.

Account settings go here.

Code

TSX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"

export function TabsDemo() {
  return (
    <Tabs defaultValue="account" className="w-full">
      <TabsList>
        <TabsTrigger value="account">Account</TabsTrigger>
        <TabsTrigger value="password">Password</TabsTrigger>
      </TabsList>
      <TabsContent value="account">Account settings go here.</TabsContent>
      <TabsContent value="password">Password settings go here.</TabsContent>
    </Tabs>
  )
}

API Reference

PropTypeDefaultDescription
defaultValuestring-The value of the tab that should be active when initially rendered.
valuestring-The controlled value of the tab to activate.
onValueChangefunction-Callback invoked when the value changes.
orientationhorizontal | verticalhorizontalThe orientation of the tabs.