Tabs
Organize content into switchable panels.
Overview
Tabs organize content into panels that share the same space, one visible at a
time. Compose them from TabsList, TabsTrigger, and TabsContent.
A snapshot of your workspace at a glance.
$ npx morpha-ui add tabsExamples
Line
Set variant="line" on TabsList for the underline style; the primary bar
slides between tabs.
Everything in your inbox.
Disabled tab
Your project overview.
Installation
Morpha UI components are distributed via the Morpha CLI (coming in a later
step): npx morpha-ui add tabs. In the meantime, since this is the base
shadcn component, you can also add it directly:
npx shadcn@latest add tabsAPI Reference
The table documents the Tabs root. TabsList, TabsTrigger, and
TabsContent forward their Base UI props; each TabsContent is associated with a
trigger by matching value.
Prop
Type
Accessibility
- Place every
TabsTriggerinside aTabsList. - Arrow keys move focus between tabs (Base UI); Space/Enter activates the focused tab.
- Each
TabsContentis linked to its trigger via a sharedvalue.