Tabs
A set of layered sections of content that are displayed one at a time.
Installation
bash
npx shadcn@latest add tabsImport
import { Tabs, TabsList, TabsTrigger, TabsContent } from "@/components/ui/tabs"Default
Manage your account settings.
Disabled tab
Account content.
Props
Tabs
PROPTYPEDEFAULTDESCRIPTION
defaultValuestring—Default active tab value (uncontrolled)valuestring—Controlled active tab valueonValueChange(value: string) => void—Called when active tab changesorientation"horizontal" | "vertical""horizontal"Orientation of the tab listTabsTrigger
PROPTYPEDEFAULTDESCRIPTION
valuestring—Unique value identifying this tab (required)disabledbooleanfalseDisables the tab triggerTabsContent
PROPTYPEDEFAULTDESCRIPTION
valuestring—Value matching the corresponding TabsTrigger (required)forceMountbooleanfalseForce mount the content even when not activeAccessibility
- Arrow Left/Right navigates between tabs
- Space/Enter activates the focused tab
- Each panel is linked to its trigger via
aria-controls