Tabs
Organizes content into separate views within the same context.
- Status
- ReadyBuild day 8 of 21
- Code
- In React
- Role
- Navigation
Usage
This demo is live, and the code below it is the same code, imports included. The component lives in src/ui of this repository and is not published to npm yet.
Pastes as editable layers. Shadows are not exported.
import { Tabs, type TabItem } from "@/ui";
const items: TabItem[] = [
{ id: "all", label: "All", value: "12", content: "All twelve transactions." },
{ id: "in", label: "Incoming", content: "Money received." },
];
export default function TabsDemo() {
return <Tabs label="Transactions" items={items} />;
}Variants and states
Every specimen is the real component from src/ui, held in one state.
Pastes as editable layers. Shadows are not exported.
Props
- label
- string · default none
- Required. Names the tab list for screen readers.
- items
- TabItem[] · default none
- Each has id, label, and optionally value (a count), icon, disabled, and content (the panel).
- type
- "underline" | "pill" | "segmented" · default "underline"
- The style of the list.
- size
- "sm" | "md" | "lg" · default "md"
- Height of a tab: 32, 40, or 48.
- value, onChange
- string, (id) => void · default none
- Controlled selection. Leave out value for an uncontrolled list.
- defaultValue
- string · default none
- The first selected tab when uncontrolled. Defaults to the first enabled tab.
Figma to code
Figma properties by their exact names from Naming, and the React prop that carries each one. The table covers the shared properties that bear on this component; the Figma file decides which of them its component exposes. None means there is no prop for it yet.
- 🧰 Type
- type
- underline, pill, or segmented.
- 📐 Size
- size
- sm, md, or lg.
- 🎯 State
- disabled
- Active is the selection. Hover is the browser. Disabled is on the item.
- Label, Show Value, Value
- label, value
- Text and the count.
- Show Icon Left
- icon
- Pass an icon element.
- 🔀 Count
- items
- 2 to 5 Tab is the length of items.
Accessibility
What the code in src/ui does today, and what it leaves to you.
Keyboard
- Tab moves focus into the list on the selected tab, and out again. Only the selected tab is in the tab order.
- Left and Right arrows move to the previous or next enabled tab and select it. Home and End go to the first and last.
- A disabled tab is skipped.
Screen readers
- The list has role=tablist with the label. Each tab has role=tab and aria-selected.
- The panel has role=tabpanel and is named by its tab through aria-labelledby.
What you still need to do
- Give each tab a short label. A long label wraps and breaks the row.
- Pass content on the items, or render the panel yourself with the same ids.
When to use
Switches between related views without leaving the page.
Do and don't
Do
- Keep tab labels short and parallel in structure.
- Keep it to five tabs or fewer. More than that wraps on a 360px screen.
Don't
- Use tabs for steps that must happen in order. That is a Stepper.
- Hide critical information behind a non-default tab.
Related
4 of 28 other molecules, same role and ready ones first.
- Navigation BarThe main app navigation: a top bar on desktop, a bottom bar on mobile.Ready
- PaginationSplits large sets of content across multiple pages.Ready
- StepperShows progress through a task split into ordered steps.Ready
- AccordionStacked sections that expand to reveal their content.Ready
Status reflects the component tracker snapshot of 29 October 2026.