Tabs
Navigationshadcn/uiSwitches between views of the same content. Segmented for 2 to 4 short options, underline for page sections.
When to use
- Keep labels to one or two words.
- Use segmented full width on mobile with className 'w-full' on TabsList.
- Don't use Tabs for steps in a flow; use a Stepper.
- Don't use more than 4 segmented tabs or 6 underline tabs.
Accessibility
- Role
- tablist / tab / tabpanel
- Keyboard
- Arrow keys move between tabs. Tab moves into the panel.
- Notes
- Radix wires aria-selected and aria-controls.
Props
variant= 'segmented''segmented' | 'underline'Look.
value / onValueChange / defaultValuestringSelected tab.
Prompt for your agent
Use the UnbuiltUI Tabs. Call unbuilt_get_component("Tabs") first and follow its spec: variants, states, usage rules and accessibility.
unbuilt_get_component returns
2 variants5 states2 props4 usage rules3 a11y notes9 tokens1 example
Add it with shadcn
$
npx shadcn add https://unbuiltui.com/r/tabs.jsonTokens · 9
bg.subtlebg.raisedbg.inversefg.defaultfg.mutedborder.subtleborder.focusradius.mdshadow.raised