Tabs
Switch between sibling views of the same object.
{/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */}
Switch between sibling views of the same object.
Import
import { Tabs, TabsList, TabsTrigger, TabsContent } from "@ir/ui";Watch out
- One defect followed in code but not in the file: Figma's
Current=False, Type=Underline, State=Focusis byte-identical to its Default — no ring, no indicator. Every other Focus variant carriesring/focus. A focus state that does not show focus is a keyboard trap, so the code rings every tab; the file wants the same fix.
Props
| Prop | Type | Required | What it does |
|---|---|---|---|
fullWidth | boolean | Stretch the tabs to fill the row. Figma's Full width. |
Do and don't
Use them for views of one object — an endpoint's Overview, Trunks, Alerts.
Don't — Use tabs to move between different objects, or as page navigation.
Tabs promise you are still looking at the same thing. Break that and people lose track of what they are on.
Underline for page sections, Minimal inside a card or drawer, Brand/Gray/Border for compact toggles.
Don't — Use a segmented control for page-level sections.
The file assigns each type a place. Segmented styles read as a control; underline reads as structure.
Switch to Line tabs past about six sections, or when labels are long.
Don't — Cram nine long labels into a horizontal row.
Horizontal tabs that wrap or scroll hide their own options, which defeats the point of showing them all.
Use Stepper for order, tabs for free movement.
Don't — Use tabs for a sequence someone must complete in order.
Tabs say "look wherever you like". A sequence needs to say "finish this first".
Give the panel a stable minimum height where the content varies.
Don't — Let the panel resize the page as you move between tabs.
The tabs move under the pointer if the page reflows, and the next click lands on the wrong one.
Accessibility
- Radix supplies the tablist, tab and tabpanel roles and arrow-key movement between tabs.
- The panel is focusable and carries its own ring, so keyboard users reach the content after the tab strip rather than tabbing through every tab first.
Where it is drawn
Figma — structure from figma, measurements from figma.