<!-- generated by scripts/gen-docs.mjs from docs/system/tabs.md. Edit the source and rerun. -->
# Tabs

## Description
Switches between views of one thing in place, with one list of tabs and one panel showing at a time.

`import { Tabs, TabsList, TabsTrigger, TabsContent, tabsListVariants } from "@/components/cobalt/ui/tabs"`, source `registry/cobalt/ui/tabs.tsx`, status `ready-with-gaps`.
Foundation: `shadcn tabs (base-luma, base)`. Traps checked: `trap/tabs-routes` (Usage, `rule/tabs-switch-panels-not-routes`), `trap/current-unmarked` (ARIA: `aria-selected` on the active tab, `data-active` for the styles), `trap/weight-shift` (States, active: the weight stays 500, only the colour and the pill change, measured), `trap/control-height` (States, default: tabs are 28px in the default track, which is 36px with its 4px of padding, the same as `--control`, and `--control` tall in the line variant), `trap/focus-ring-shape` (States, focus-visible: the global outline follows the round tab), `trap/hover-beats-focus` (State precedence), `trap/disabled-still-hovers` (State precedence: the `hover` variant skips a disabled tab, so it keeps its colour under the pointer), `trap/motion-restart` (Motion: a CSS transition on the indicator retargets from where it is), `trap/motion-layout-property` (Motion: left, top, width and height, the named exception in the source, because they are Base UI's own measured variables), `trap/reduced-motion-ignored` (Motion: the indicator jumps and the label colour still changes), `trap/list-dead-gap` (States, default: tabs sit 4px apart on the pill track and in the line variant, as SegmentedControl's options and Nav's links do; the gap belongs to no tab, by design, so the hover state ends at the tab), `trap/narrow-hidden-nav` (Limits, `rule/tabs-max-four-at-390`), `trap/toggle-switch-submit` and `trap/toggle-indeterminate` (n/a, Toggles traps for a list that is never on or off).

### Foundation
| Given by the foundation | Added by the team |
|---|---|
| Base UI `Tabs.Root` with `value`, `defaultValue`, `onValueChange` and `orientation`; `Tabs.List` with roving focus, the arrow keys, Home and End, and `activateOnFocus` off so arrows move focus and Enter or Space activates; `Tabs.Tab` as a native `<button>` with `role="tab"`, `aria-selected` and `aria-controls`; `Tabs.Panel` with `role="tabpanel"`, the inactive panels left out of the DOM unless `keepMounted`; `Tabs.Indicator`, which measures the active tab into `--active-tab-left`, `--active-tab-width`, `--active-tab-top` and `--active-tab-height` and stays hidden until it has | The `variant` on `TabsList`: `default`, the white pill on the grey track (D18), and `line`, the 2px ink line under the active tab, or at the list's right edge when vertical, with a 16px gap to the panel so the line does not touch it, and 24px between a vertical track and its panel, so the panel reads as a column of its own rather than as part of the track (it was 8px, the gap under a horizontal list); the indicator pinned to the list's start and moved to Base UI's variables with `translate`, slid on the settle spring, `duration-settle ease-settle` (D17), as SegmentedControl's thumb, so the slide is composited as `useIndicator`'s is, with only its width (or height, vertical) also transitioning on that small box; a mouse or a pen activates a tab on press and a touch on lift, the pressed label in ink from touchdown (`pressToChoose`, shared with SegmentedControl); a horizontal list that runs out of room scrolls sideways with its scrollbar hidden, brings the active tab into view clear of the fade on load and when it changes, and fades the edge with more (`useScrollRow` and `scrollRowFade` from ChipRow); tabs 28px tall (`min-h-7`) inside the default track, with `touch-target` so a coarse pointer reaches the whole 36px track (the list scrolls sideways, so it clips the 44px area at its edge; measured 28px tall before, 36px after, iPhone 13 emulation, 2026-10-17), whose 4px of padding makes it 36px, the same height as a button or a field, and `--control` tall in the line variant, which has no track (`rule/layout-one-control-height`), with no weight change on selection, colour only; 12px of side padding and a 6px gap to a glyph, Button's, with `data-icon` padding for a glyph at either end; 4px between tabs on the track, as in SegmentedControl; `disabled` tabs at half opacity, which the `hover` variant and a press leave alone; the track `--r-track` and every tab and the pill `--r-thumb`, the outer radius less the 4px of padding (D38), in a vertical list too; the pill is the thumb (`--thumb`) with the faint `shadow-glass` edge, the same as SegmentedControl, and no ring, the global outline in `base.css` draws focus; the root as a grid with `content-start`, so a parent that stretches it (a grid cell, a flex column) never stretches the track or the thumb, and every `TabsContent` defaulting to `keepMounted` and sharing one grid cell, the hidden ones `invisible`, so the tabs hold the tallest panel's height and nothing around them moves when the tab changes (D37) `max-w-full` on the list and wrapping labels (`text-center`, `text-start` when vertical, no `nowrap`), so long translated tabs wrap at their spaces, and a horizontal list whose words still do not fit scrolls inside its own box (`overflow-x-auto`) instead of running past the container, with the line variant padded 4px (`-m-1 p-1`, its line at `bottom-0`) so the scroll box clips neither the line nor a focus ring; the vertical line sits at `end-0` and the glyph trims are `ps` and `pe`, so right-to-left text puts them on the correct side (`docs/research/2026-10-16-break-ui-inputs.md`). |

## Examples
A fund's views on the grey track, the line under a heading and in a card, a settings page down the side, and a view not available yet.

Real uses, 0 call sites (`rg -n "<Tabs\b" app registry docs/system/examples --glob '!registry/cobalt/ui/*' --glob '!docs/system/examples/**'`): the showcase chrome switches sections with Nav and views with SegmentedControl, and the examples folder does not count.

Uses inside the registry: none.

### Example files
| File | Covers | Caption |
|---|---|---|
| `docs/system/examples/tabs/default.tsx` | default | Three views of one fund on the page tint, the white thumb on the grey track marking the open one |
| Not applicable: default.tsx is the grey track | variant=default | The white thumb on the grey track marks the open tab |
| `docs/system/examples/tabs/variant-line.tsx` | variant=line | The ink line under the open tab, for a page section |
| `docs/system/examples/tabs/orientation-vertical.tsx` | orientation=vertical | Stacked at the start of a settings page from 640px, and across the top below it |
| Not applicable: horizontal is the default orientation, shown in default.tsx | orientation=horizontal | The list across the top |
| Not applicable: the active tab is in every example, under the pill or over the line | state:active | `aria-selected="true"`, `data-active`, the label in `--foreground` |
| `docs/system/examples/tabs/state-disabled.tsx` | state:disabled | A view that is not available yet keeps its place, skipped by the arrows, with its panel kept for later |
| Not applicable: hover is reached with the pointer on any example | state:hover | The label of an inactive tab turns to `--foreground` |
| Not applicable: focus-visible is reached with the keyboard on any example | state:focus-visible | The 2px outline 2px outside the round tab |
| `docs/system/examples/tabs/overflow.tsx` | state:overflow | In a narrow side panel, four views of a booking do not fit, so the list scrolls sideways; it opens on Payments, the last tab, already in view, with a fade at the edge that has more |
| `docs/system/examples/tabs/in-card.tsx` | composition:Card | The line variant inside a card, so the card keeps one fill, switching between two views of a paper |
| Not applicable: the tiles show each variant and orientation | matrix:variant,orientation | Both variants, across and down |

Example: Three views of one fund on the page tint, the white thumb on the grey track marking the open one (`docs/system/examples/tabs/default.tsx`)

```tsx
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/cobalt/ui/tabs";

const views: { value: string; label: string; rows: [string, string][] }[] = [
  {
    value: "overview",
    label: "Overview",
    rows: [
      ["Net assets", "$4.8B"],
      ["Expense ratio", "0.42%"],
      ["Holdings", "186"],
    ],
  },
  {
    value: "holdings",
    label: "Holdings",
    rows: [
      ["Northgate Treasury 2031", "4.2%"],
      ["Calder Global Equity", "3.1%"],
      ["Harbour Short Duration", "2.6%"],
    ],
  },
  {
    value: "filings",
    label: "Filings",
    rows: [
      ["13F for the second quarter", "Aug 14"],
      ["13F for the first quarter", "May 15"],
      ["Form ADV, annual", "Mar 28"],
    ],
  },
];

export default function Example() {
  return (
    <Tabs defaultValue="overview" className="w-full max-w-sm">
      <TabsList>
        {views.map((view) => (
          <TabsTrigger key={view.value} value={view.value}>
            {view.label}
          </TabsTrigger>
        ))}
      </TabsList>
      {views.map((view) => (
        <TabsContent key={view.value} value={view.value}>
          <ul className="flex flex-col gap-2">
            {view.rows.map(([name, value]) => (
              <li key={name} className="flex justify-between gap-3">
                <span className="min-w-0 wrap-break-word">{name}</span>
                <span className="shrink-0 text-muted-foreground tabular-nums">{value}</span>
              </li>
            ))}
          </ul>
        </TabsContent>
      ))}
    </Tabs>
  );
}
```

Example: The line variant inside a card, so the card keeps one fill, switching between two views of a paper (`docs/system/examples/tabs/in-card.tsx`)

```tsx
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/cobalt/ui/card";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/cobalt/ui/tabs";

export default function Example() {
  return (
    <Card className="w-full max-w-md">
      <CardHeader>
        <CardTitle>Liquidity in open-end bond funds</CardTitle>
        <CardDescription>Working paper, March 2026.</CardDescription>
      </CardHeader>
      <CardContent>
        <Tabs defaultValue="summary">
          <TabsList variant="line">
            <TabsTrigger value="summary">Summary</TabsTrigger>
            <TabsTrigger value="cited">Cited by</TabsTrigger>
          </TabsList>
          <TabsContent value="summary">
            <p className="text-pretty">
              Bond funds that promise daily redemptions hold more cash after a run, and sell their most liquid bonds
              first when they do not.
            </p>
          </TabsContent>
          <TabsContent value="cited">
            <ul className="flex flex-col gap-2">
              <li className="flex justify-between gap-3">
                <span className="min-w-0 wrap-break-word">Swing pricing in European bond funds</span>
                <span className="shrink-0 text-muted-foreground tabular-nums">2026</span>
              </li>
              <li className="flex justify-between gap-3">
                <span className="min-w-0 wrap-break-word">Redemption gates and fire sales</span>
                <span className="shrink-0 text-muted-foreground tabular-nums">2026</span>
              </li>
            </ul>
          </TabsContent>
        </Tabs>
      </CardContent>
    </Card>
  );
}
```

## Variants

### variant
- `default`: the white pill on the grey track, for tabs on the page tint. Used at 0 call sites.
- `line`: no track, the 2px ink line under the active tab, for tabs inside a card or under a heading. Used at 0 call sites.

Example: The ink line under the open tab, for a page section (`docs/system/examples/tabs/variant-line.tsx`)

```tsx
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/cobalt/ui/tabs";

export default function Example() {
  return (
    <Tabs defaultValue="advisers" className="w-full max-w-sm">
      <TabsList variant="line">
        <TabsTrigger value="advisers">Advisers</TabsTrigger>
        <TabsTrigger value="funds">Funds</TabsTrigger>
      </TabsList>
      <TabsContent value="advisers">
        <ul className="flex flex-col gap-2">
          <li>Harbour Capital</li>
          <li>Northgate Partners</li>
          <li>Calder Investment Management</li>
        </ul>
      </TabsContent>
      <TabsContent value="funds">
        <ul className="flex flex-col gap-2">
          <li>Harbour Large Cap Core</li>
          <li>Northgate Credit Opportunities</li>
          <li>Calder Global Equity</li>
        </ul>
      </TabsContent>
    </Tabs>
  );
}
```

Example: Stacked at the start of a settings page from 640px, and across the top below it (`docs/system/examples/tabs/orientation-vertical.tsx`)

```tsx
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/cobalt/ui/tabs";
import { useMediaQuery } from "@/lib/cobalt/use-media-query";

const views: { value: string; label: string; rows: [string, string][] }[] = [
  {
    value: "profile",
    label: "Profile",
    rows: [
      ["Name", "Ana Lima"],
      ["Email", "ana@example.com"],
      ["Time zone", "Europe/Lisbon"],
    ],
  },
  {
    value: "alerts",
    label: "Alerts",
    rows: [
      ["New filings", "Email and push"],
      ["Late filings", "Email"],
      ["Weekly summary", "Mondays, 08:00"],
    ],
  },
  {
    value: "billing",
    label: "Billing",
    rows: [
      ["Plan", "Team, 12 seats"],
      ["Next invoice", "Nov 1, $348"],
      ["Card", "Ends in 0817"],
    ],
  },
];

export default function Example() {
  // Below 640px a list down the side would leave the panel under 200px wide.
  const wide = useMediaQuery("(min-width: 640px)");
  return (
    <Tabs defaultValue="profile" orientation={wide ? "vertical" : "horizontal"} className="w-full max-w-lg">
      <TabsList>
        {views.map((view) => (
          <TabsTrigger key={view.value} value={view.value}>
            {view.label}
          </TabsTrigger>
        ))}
      </TabsList>
      {views.map((view) => (
        <TabsContent key={view.value} value={view.value}>
          {/* Rows as tall as a tab, starting as far down as the first tab does, so the first row
              lines up with the tab beside it. */}
          <ul className="flex flex-col gap-1 group-data-[orientation=vertical]/tabs:pt-1">
            {view.rows.map(([name, value]) => (
              <li key={name} className="flex min-h-7 items-center justify-between gap-3">
                <span className="min-w-0 wrap-break-word">{name}</span>
                <span className="shrink-0 text-muted-foreground tabular-nums">{value}</span>
              </li>
            ))}
          </ul>
        </TabsContent>
      ))}
    </Tabs>
  );
}
```

## States
| State | Trigger | What the user can do | Shown by, besides color | Checked by |
|---|---|---|---|---|
| default | render | press a tab, focus the list | the list of tabs, 28px tall in a 36px track or `--control` tall in the line variant, the active one marked; one panel visible below or beside, in a cell as tall as the tallest panel | screenshot |
| active | `value` or `defaultValue` matches, after a press, Enter or Space | press another tab | the pill or the line measured to the tab, the label in `--foreground`, `aria-selected="true"`, `data-active`; its panel visible, the others mounted and `invisible` in the same cell | test |
| hover | pointer over an inactive tab | press | the label turns from `--muted-foreground` to `--foreground`, no fill and no shape change | by hand |
| pressed | pointer down | let go, or drag off | a mouse or a pen activates the tab on press, so the indicator starts toward it under the press; a touch marks the tab `data-pressing` and its label turns to `--foreground` at once, and activation waits for the lift, so a scroll can cancel it | by hand |
| focus-visible | keyboard focus, one tab stop on the active tab | arrows move focus, Enter or Space activates | the 2px outline 2px outside the round tab | by hand |
| disabled | `disabled` on a `TabsTrigger` | nothing; the arrows skip it | half opacity, `disabled` and `aria-disabled="true"`; hover and a press change nothing | test |
| vertical | `orientation="vertical"` on `Tabs` | Up and Down move focus | the list as a column at `rounded-xl`, the pill and the tabs at `rounded-md`, 24px from the panel, or the line at the list's right edge, 16px from the panel, each tab full width and 28px tall, as in a row (`--control` in the line variant), `aria-orientation="vertical"` | test |

Example: A view that is not available yet keeps its place, skipped by the arrows, with its panel kept for later (`docs/system/examples/tabs/state-disabled.tsx`)

```tsx
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/cobalt/ui/tabs";

export default function Example() {
  return (
    <Tabs defaultValue="holdings" className="w-full max-w-sm">
      <TabsList>
        <TabsTrigger value="holdings">Holdings</TabsTrigger>
        <TabsTrigger value="filings">Filings</TabsTrigger>
        {/* The fund has not filed its voting record for the year, so the view has nothing to show yet. */}
        <TabsTrigger value="votes" disabled>
          Votes
        </TabsTrigger>
      </TabsList>
      <TabsContent value="holdings">
        <ul className="flex flex-col gap-2">
          <li className="flex justify-between gap-3">
            <span className="min-w-0 wrap-break-word">Northgate Treasury 2031</span>
            <span className="shrink-0 text-muted-foreground tabular-nums">4.2%</span>
          </li>
          <li className="flex justify-between gap-3">
            <span className="min-w-0 wrap-break-word">Calder Global Equity</span>
            <span className="shrink-0 text-muted-foreground tabular-nums">3.1%</span>
          </li>
        </ul>
      </TabsContent>
      <TabsContent value="filings">
        <ul className="flex flex-col gap-2">
          <li className="flex justify-between gap-3">
            <span className="min-w-0 wrap-break-word">13F for the second quarter</span>
            <span className="shrink-0 text-muted-foreground tabular-nums">Aug 14</span>
          </li>
          <li className="flex justify-between gap-3">
            <span className="min-w-0 wrap-break-word">13F for the first quarter</span>
            <span className="shrink-0 text-muted-foreground tabular-nums">May 15</span>
          </li>
        </ul>
      </TabsContent>
      <TabsContent value="votes">
        <p className="text-muted-foreground">The voting record for this year is due Aug 31.</p>
      </TabsContent>
    </Tabs>
  );
}
```

Example: In a narrow side panel, four views of a booking do not fit, so the list scrolls sideways; it opens on Payments, the last tab, already in view, with a fade at the edge that has more (`docs/system/examples/tabs/overflow.tsx`)

```tsx
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/cobalt/ui/tabs";

const views: { value: string; label: string; rows: [string, string][] }[] = [
  {
    value: "guest",
    label: "Guest",
    rows: [
      ["Name", "Mira Okafor"],
      ["Email", "mira@example.com"],
    ],
  },
  {
    value: "rooms",
    label: "Rooms",
    rows: [
      ["Harbour suite", "2 nights"],
      ["Garden double", "2 nights"],
    ],
  },
  {
    value: "requests",
    label: "Requests",
    rows: [
      ["Late arrival", "After 10 PM"],
      ["Cot", "In the suite"],
    ],
  },
  {
    value: "payments",
    label: "Payments",
    rows: [
      ["Deposit", "Paid Oct 2"],
      ["Balance", "Due Oct 23"],
    ],
  },
];

export default function Example() {
  return (
    <Tabs defaultValue="payments" className="w-full max-w-64">
      <TabsList>
        {views.map((view) => (
          <TabsTrigger key={view.value} value={view.value}>
            {view.label}
          </TabsTrigger>
        ))}
      </TabsList>
      {views.map((view) => (
        <TabsContent key={view.value} value={view.value}>
          <dl className="flex flex-col gap-2">
            {view.rows.map(([term, detail]) => (
              <div key={term} className="flex justify-between gap-3">
                <dt className="text-muted-foreground">{term}</dt>
                <dd className="text-end">{detail}</dd>
              </div>
            ))}
          </dl>
        </TabsContent>
      ))}
    </Tabs>
  );
}
```

### State precedence
- Active and hover: active wins. The active label is already `--foreground`, so hovering it changes nothing.
- Hover and focus-visible: both show. The outline is drawn outside the tab and the label colour inside it.
- Active and focus-visible: both show. The outline sits around the pill or above the line.
- Disabled and hover: disabled wins. The `hover` variant skips a disabled element, so no colour change shows, and a double-click selects no text.
- Disabled and focus-visible: disabled wins. The arrows skip the tab and it leaves the tab order.
- Disabled and active: active wins. A tab that is active and then disabled keeps its panel until another tab is chosen.
- Active and another active: Not applicable: one tab is active at a time, `value` is one string.

### Motion
| Trigger | Kind | Preset | Properties | Reduced motion |
|---|---|---|---|---|
| the active tab changes | announce | `duration-settle ease-settle` (`--t-settle`, 300ms, on `--curve-settle`); the indicator is hidden until Base UI first measures it, so it never travels from nothing | `translate` and width across, `translate` and height down, on the indicator (measured computed `transition-property: translate, width, height`, was `left, top, width, height`) | the indicator jumps; `base.css` drops those transitions and keeps the label colour change |
| pointer over and out, a touch on a tab (`data-pressing`), and the active label change | announce | `duration-press` (`--t-press`, 140ms) on `--curve`, `transition-colors` | color on the tab | the same colour change |
| the active tab changes in a list that scrolls | announce | a smooth scroll of the list, at once under reduced motion and on first render | scrollLeft | the list jumps |

## Props

<!-- Props generated from registry/cobalt/ui/tabs.tsx with TypeScript by scripts/props-table.mjs -->
### Tabs

No props of its own.

Also accepts every native `<div>` attribute; from Base UI: `defaultValue`, `onValueChange`, `orientation`, `render`, `value`.

### TabsList

| Prop | Type | Default | Purpose |
|---|---|---|---|
| `variant?` | `"default" \| "line"` | `"default"` | `default` the white pill on the grey track; `line` no track. |

Also accepts every native `<div>` attribute; from Base UI: `activateOnFocus`, `loopFocus`, `render`.

### TabsTrigger

No props of its own.

Also accepts every native `<button>` attribute; from Base UI: `disabled`, `nativeButton`, `render`, `value`.

### TabsContent

No props of its own.

Also accepts every native `<div>` attribute; from Base UI: `keepMounted`, `render`, `value`.

`Tabs` passes every Base UI `Tabs.Root` prop: `value`, `defaultValue`, `onValueChange`, `orientation` (defaults to horizontal, set on `data-orientation` for the styles). `TabsList` adds `variant`, `default` or `line`, and passes `Tabs.List` props such as `activateOnFocus` and `loopFocus`. `TabsTrigger` passes `Tabs.Tab` props: `value`, `disabled`, `render`. `TabsContent` passes `Tabs.Panel` props: `value`, and `keepMounted`, which defaults to true here so the panels stack and the tabs hold the tallest one's height; pass `keepMounted={false}` for a heavy panel that should not render until it is chosen. `tabsListVariants` is exported for a host that styles a list of its own. `className` is merged last on each part and is for placement.

## Usage

### When to use
- One object has 2 to 4 views and you switch between them in place: overview, activity, settings.
- The views share one heading and one URL, and switching loses nothing.

### When not to use
- The tabs change the URL or load another page. Use NavTabs or Nav instead.
- The choice is a value, not a view, such as a range or a sort. Use SegmentedControl instead.
- There are more than 4 views at 390px, or the labels run past 8 characters. Use Select for the view, or split the page, instead. A list that still runs out of room, in a narrow panel or a long translation, scrolls sideways with the active tab in view.
- The views are steps in order. Use Button for each step, with one panel per step, instead, so the next step is an action.

### Rules
- `rule/tabs-switch-panels-not-routes`: When the tabs change the URL or load another page, use `NavTabs` with `href` on each item instead of `Tabs` with a navigate call in `onValueChange`, because a tablist promises panels that switch in place and a screen reader announces "tab, 1 of 3", not a link. Evidence: principle platform: the WAI-ARIA tabs pattern switches tabpanels, and an anchor navigates; person D18. Check: review of every `onValueChange` that calls a router.
  - Don't: `<Tabs value={section} onValueChange={(next) => navigate(\`/${next}\`)}><TabsList><TabsTrigger value="people">People</TabsTrigger></TabsList></Tabs>`
  - Do: `<NavTabs label="Sections" activeKey={section} items={[{ key: "people", label: "People", href: "/people" }]} />`
- `rule/tabs-panel-per-tab`: When a `TabsTrigger` is rendered, a `TabsContent` with the same `value` exists, because a tab without a panel is announced as selected and shows nothing, and `aria-controls` points at nothing. Evidence: principle wcag: 4.1.2 Name, role, value, the tab's `aria-controls` names its panel; principle wcag: 1.3.1 Info and relationships. Check: test `tabs.test.tsx` renders the active tab's panel and keeps the other hidden; review.
  - Don't: `<Tabs defaultValue="overview"><TabsList><TabsTrigger value="overview">Overview</TabsTrigger><TabsTrigger value="activity">Activity</TabsTrigger></TabsList><TabsContent value="overview">...</TabsContent></Tabs>`
  - Do: `<Tabs defaultValue="overview"><TabsList><TabsTrigger value="overview">Overview</TabsTrigger><TabsTrigger value="activity">Activity</TabsTrigger></TabsList><TabsContent value="overview">...</TabsContent><TabsContent value="activity">...</TabsContent></Tabs>`
- `rule/tabs-keep-panels-mounted`: When panels differ in height, keep the default on `TabsContent` instead of passing `keepMounted={false}`, because a height change moves what sits below or beside the tabs each time the tab changes. Evidence: person D37. Check: review of every `keepMounted={false}`.
  - Don't: `<TabsContent value="activity" keepMounted={false}>...</TabsContent>`
  - Do: `<TabsContent value="activity">...</TabsContent>`
- `rule/tabs-line-inside-cards`: When tabs sit inside a Card or another filled surface, use `variant="line"`, and keep the pill track for tabs on the page tint, because the white pill against the grey track measures 1.16:1 and on a white card the track alone would mark the tabs as a second surface. Evidence: measured 1.16:1 light and 1.18:1 dark for the pill against the track, .design-system/evidence/tabs/grow-count-390.json; person D18. Check: review of every TabsList inside a Card.
  - Don't: `<Card><CardContent><Tabs defaultValue="unread"><TabsList>...</TabsList></Tabs></CardContent></Card>`
  - Do: `<Card><CardContent><Tabs defaultValue="unread"><TabsList variant="line">...</TabsList></Tabs></CardContent></Card>`
- `rule/tabs-disabled-keeps-its-place`: When a view is not available yet, pass `disabled` on its `TabsTrigger` and keep its `TabsContent`, instead of leaving the tab out until it is ready, because a tab that appears later moves its neighbours and the pill, and the arrows already skip a disabled tab. Evidence: principle heuristic: consistency and standards, the list keeps its shape; principle input: keyboard, a disabled tab leaves the roving order. Check: test `tabs.test.tsx` "a disabled tab is disabled in the markup"; review.
  - Don't: `{published ? <TabsTrigger value="published">Published</TabsTrigger> : null}`
  - Do: `<TabsTrigger value="published" disabled={!published}>Published</TabsTrigger>`
- `rule/tabs-vertical-from-640`: When the list is vertical, use it only from 640px up and switch to horizontal below, because a vertical list takes a column beside the panel and at 390px the panel would be under 200px wide. Evidence: measured a 310px column at 390 in the showcase, .design-system/evidence/tabs/grow-count-390.json; principle heuristic: flexibility and efficiency of use, one layout per width. Check: review of every `orientation="vertical"` for a width switch.
  - Don't: `<Tabs orientation="vertical" defaultValue="profile">`
  - Do: `<Tabs orientation={wide ? "vertical" : "horizontal"} defaultValue="profile">` with `wide` from a 640px match

### Content
- Follows `rule/writing-heading-sentence-case`.
- `rule/tabs-label-is-the-view`: When a tab is labelled, write one or two words in sentence case naming the view, such as "Activity" or "All items", at most 8 characters per word and no verb, because the tabs read as a list of places and the 4-tab limit is measured with the 8-character "Settings". Evidence: person D11; measured 4 tabs of "Settings" fit at 390 with 24px to spare, .design-system/evidence/tabs/grow-count-390.json. Check: lint rule/ban-uppercase (scripts/check-system.mjs); review.
  - Don't: `<TabsTrigger value="activity">SEE ACTIVITY</TabsTrigger>`
  - Do: `<TabsTrigger value="activity">Activity</TabsTrigger>`

### Anti-slop
- `rule/tabs-no-own-indicator`: When an agent marks the active tab with a `border-b-2`, a fill or a bold weight on `TabsTrigger`, pass no such `className` and let the `TabsList` indicator show the active tab, because the system has one selection indicator and a second mark moves at another speed. Evidence: person D17; person D18. Check: lint rule/component-override on TabsTrigger (scripts/check-system.mjs).
  - Don't: `<TabsTrigger value="people" className="data-active:border-b-2 data-active:border-primary data-active:font-semibold">People</TabsTrigger>`
  - Do: `<TabsTrigger value="people">People</TabsTrigger>`
- `rule/tabs-no-icon-by-default`: When a tab has a text label, leave the icon off `TabsTrigger` and its `data-icon` padding unused, unless the icon is how the view is found by shape, because an icon beside every label makes none of them findable and widens each tab by 24px. Evidence: principle heuristic: aesthetic and minimalist design, every extra glyph dilutes the label; measured 4 tabs of "Settings" end at 365px of 390 without icons, .design-system/evidence/tabs/grow-count-390.json. Check: review.
  - Don't: `<TabsTrigger value="people"><UsersIcon /> People</TabsTrigger> <TabsTrigger value="teams"><LayersIcon /> Teams</TabsTrigger>`
  - Do: `<TabsTrigger value="people">People</TabsTrigger> <TabsTrigger value="teams">Teams</TabsTrigger>`
- `rule/tabs-no-shadow-on-the-pill`: When an agent gives the pill a heavier shadow or the list a border, pass no such `className` on `TabsList`, because tabs are a flat control and the thumb's `shadow-glass` edge is the only depth they carry. Evidence: person D11. Check: lint rule/component-override on TabsList (scripts/check-system.mjs).
  - Don't: `<TabsList className="border border-border [&_[data-slot=tabs-indicator]]:shadow-raised">`
  - Do: `<TabsList>`

### Limits
- `rule/tabs-max-four-at-390`: When a view would hold more than 4 tabs, move the rest into a Select or split the page, because at 5 tabs with the longest real label, "Settings", the list runs 445px wide and leaves the 390px viewport with nothing saying more is there. Evidence: measured overflow at 5 tabs (right edge 445 > 390) in the showcase's 310px column at 390, with 4 tabs ending at 365, .design-system/evidence/tabs/grow-count-390.json. Check: probe `.design-system/scripts/grow-selection.mjs` at 390; review of the tab count in review.
  - Don't: `<TabsList>{["Overview", "Activity", "Members", "Settings", "Billing"].map((v) => <TabsTrigger key={v} value={v}>{v}</TabsTrigger>)}</TabsList>`
  - Do: `<TabsList>{["Overview", "Activity", "Members", "Settings"].map((v) => <TabsTrigger key={v} value={v}>{v}</TabsTrigger>)}</TabsList>` with Billing on its own page

- `rule/tabs-fit-translated`: When the tabs are translated, check that their longest words fit side by side in a 320px screen, and move the rest into a Select, or onto another page, when they do not, instead of letting the list run past the screen, because a tab wraps only at its spaces, never inside a word, so five German tabs need about 590px and the list scrolls inside a 272px column, which hides the last tabs behind a scroll. Evidence: measured on the stress page at 320 with the worst data, `docs/research/2026-10-16-break-ui-inputs.md`. Check: probe the stress page `/stress/tabs?data=worst&width=320` with each shipped locale's labels; review of every translated TabsList.
  - Don't: `<TabsList>{["Übersicht", "Aktivität", "Benachrichtigungen", "Berechtigungen", "Abrechnung"].map((v) => <TabsTrigger key={v} value={v}>{v}</TabsTrigger>)}</TabsList>` on a phone
  - Do: `<TabsList>{["Übersicht", "Aktivität", "Einstellungen"].map((v) => <TabsTrigger key={v} value={v}>{v}</TabsTrigger>)}</TabsList>` with the rest on the settings page

## Accessibility
Rests on Base UI `Tabs`: a `role="tablist"` of native `<button role="tab">` elements and one `role="tabpanel"`.

Contrast, as drawn (.design-system/evidence/tabs/grow-count-390.json): the active label on the pill 19.8:1 light and 17.18:1 dark; an inactive label on the track 5.17:1 light and 5.86:1 dark; on the line variant the active label 18.47:1 light and 18.97:1 dark and an inactive label 5.6:1 light and 7.66:1 dark. Every label passes WCAG 1.4.3 at AA. The pill against the track is 1.16:1 light and 1.18:1 dark, under the 3:1 of 1.4.11, so the label colour is what marks the active tab for a person who cannot see the pill. NEEDS REVIEW.

### Keyboard
| Key | Where focus is | Effect | Focus after | Checked by |
|---|---|---|---|---|
| Tab | before the list | focuses the active tab; the list is one tab stop | the active tab | by hand |
| Right Arrow or Down Arrow | a tab | moves focus to the next enabled tab, wrapping at the end; does not activate | the next tab | by hand |
| Left Arrow or Up Arrow | a tab | moves focus to the previous enabled tab, wrapping at the start | the previous tab | by hand |
| Home or End | a tab | moves focus to the first or last enabled tab | that tab | by hand |
| Enter or Space | a tab | activates it and shows its panel; the indicator travels | the tab | by hand |
| Tab | a tab | leaves the list into the active panel, which is focusable | the panel | by hand |

### ARIA
| Part | Role | Accessible name from | States and properties | Announced | Checked by |
|---|---|---|---|---|---|
| list | tablist | `aria-label` from the host, when given | `aria-orientation="vertical"` on a vertical list | "tab list" on entry | test |
| tab | tab | its text | `aria-selected`, `aria-controls` after mount, `disabled` and `aria-disabled`, `data-active` | the text, "tab", selected or not, "1 of 3" | test |
| panel | tabpanel | the tab through `aria-labelledby` | `hidden` when inactive and kept, else left out | the tab's name and "tab panel" on focus | test |
| indicator | presentation | none | `hidden` until measured | nothing | test |

## Tokens
| Part | State | Token |
|---|---|---|
| list | all | `--control` as the least height of a horizontal list, `--t-settle`, `--curve-settle` |
| list, default | all | `--muted`, `--r-track` |
| indicator, default | all | `--thumb`, `--elev-glass` through `shadow-glass`, `--r-thumb` |
| indicator, line | all | `--foreground` |
| tab | all | `--t-press`, `--curve`, `--r-thumb` |
| tab, default | all | 28px tall, from `min-h-7`; `--touch` (44px) hit area under a coarse pointer, clipped to the 36px track |
| tab, line | all | `--control` |
| tab | inactive | `--muted-foreground` |
| tab | active, hover | `--foreground` |
| tab | focus-visible | `--ring`, `--line-focus`, `--focus-offset` |

## Related
- SegmentedControl: one value among a few, with the ink pill.
- Nav and NavTabs: where you are in the app, by URL.
- Select: one of more than 4 views.
- Card: the surface tabs sit inside with the line variant.
- Section: one heading style for every titled block of a page.
- Collapsible: one section that opens under its trigger, when the views stack.
- Pagination: moves between pages of one list, not between views.
- SettingsLayout: settings in sections, each on its own address.
- Sidebar: the app's navigation down the side, in groups, with a mark that slides to the current place.
- Steps: the steps of a flow: which are done, which is current and which are next.
