Tabs
Switch between views. Underline, pill or segmented.
Add the source to a shadcn project
npx shadcn@latest add https://docs.atomus.io/r/tabs.jsonOpen in v0Installs the component source, its CSS and the Atomus tokens into components/atomus/. How the registry works
In Figma
Section titled “In Figma”From guidelines/components/tabs.md · Open in Figma: Tabs
Properties, variants and anatomy of the Figma components. React props use the same names.
Tab bar built from Tab.
Variants: 3
| Property | Type / options |
|---|---|
| Style | Underline · Pill · Segmented |
Single tab: Underline, Pill or Segmented.
Variants: 30
| Property | Type / options |
|---|---|
| Label | text |
| Icon | boolean (off) |
| Icon swap | instance swap (icon) |
| Count | boolean (off) |
| Count number | text |
| Style | Underline · Pill · Segmented |
| Size | sm · md |
| State | Default · Hover · Active · Focused · Disabled |
Vertical tabs
Section titled “Vertical tabs”Side navigation for settings and long forms.
Variants: 2
| Property | Type / options |
|---|---|
| Style | Line · Pill |
import { Tabs } from '@stanvision/atomus-react';
<Tabs aria-label="Project sections" variant="underline" items={[{ value: 'overview', label: 'Overview' }, { value: 'activity', label: 'Activity', count: 12 }]}/>Switch between views of the same object. Arrow, Home and End keys move between tabs.
Props at a glance
Section titled “Props at a glance”Full types and defaults are in React API at the end of the page.
items—[{ value, label, count?, disabled? }], two to six;aria-label.variant—underline(page sections) ·pill(sub-navigation) ·segmented(filters, chart ranges).value+onChange(controlled) ordefaultValue.
Design guidance
Section titled “Design guidance”From the Figma guidelines.
Do
- Use for views of the same content.
- Keep labels short; add counts when they help.
- Use Vertical tabs for settings.
Forbidden
- Never use tabs for sequential steps — use Progress steps.
- Never exceed seven tabs.
- Never mix tab styles on one page.
React API
Section titled “React API”Generated from react/src/components by scripts/gen-react-api.mjs — the same tables agents read in guidelines/components/tabs.md.
Use only these props; anything else is not part of the API.
import { Tabs } from '@stanvision/atomus-react'; — source: react/src/components/Tabs.tsx
| Prop | Type | Default | Description |
|---|---|---|---|
items |
TabItem[] |
required | The items. |
variant |
'underline' | 'pill' | 'segmented' |
'underline' |
Figma: Style |
value |
string |
— | Controlled value. |
defaultValue |
string |
— | Initial value when uncontrolled. |
onChange |
(value: string) => void |
— | Called with the new value. |
aria-label |
string |
— | Accessible name for the tab list |
className |
string |
— | Extra class on the root element (layout only — never restyle colours or sizes). |
Accepts only the props above.
TabItem:
| Field | Type | Description |
|---|---|---|
value |
string |
|
label |
ReactNode |
|
count? |
number |
Small count badge after the label |
disabled? |
boolean |