Use cases
- Settings pages with distinct sections (Account, Password, Notifications).
- Detail views with multiple facets (Overview, Activity, Settings).
- Dashboards switching between data views without a page reload.
- Component docs — usage / examples / accessibility panels (this site uses Tabs).
When NOT to use
- Page-level navigation — use a sidebar or NavigationMenu.
- A single collapsible section — use Collapsible or Accordion.
- Toggling a boolean — use Toggle or Switch.
Variants
| Variant | Use when |
|---|---|
default | Standard segmented tabs for most UIs. Trigger cells stay equal-width so the active state does not resize the row. |
underline | Minimal look — bottom border only, suits page-level sections. Inactive tabs reserve the border height. |
pills | Spaced button-style tabs for dashboards and toolbars. Every tab reserves the pill border in all states. |
Composition
- Tabs is controlled via
value/onValueChange. For uncontrolled usage, passdefaultValue. - Each
TabsTriggeraccepts aniconprop for leading icons — pair icon + text for scanability. disabledon a trigger prevents selection and greys out the tab.TabsContentrenders lazily — only the active panel is in the DOM.- Every
TabsListvariant reserves active-state borders up front so tab selection does not resize the row. - Default
TabsListuses stable equal-width cells. Useunderlineorpillsfor natural-width tabs that still keep a stable footprint.
Related
- Toggle — single on/off button.
- Accordion — vertically stacked collapsible sections.
- NavigationMenu — site-level navigation.