# Tabs

Switch between related panels using a `1px` bottom border bar and a `4px` `primary` active trigger rule. Built on Radix Tabs for keyboard navigation and ARIA linking.

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| Tabs.defaultValue / value | string | — | Initial or controlled active tab value. |
| TabsList.size | "sm" \| "md" \| "lg" | "md" | Control height tier shared by all triggers in the list. |
| TabsTrigger.value | string | — | Unique identifier linking the trigger to its TabsContent. |
| TabsTrigger.disabled | boolean | false | Prevents activation and skips keyboard focus. |

## Sizes and tokens

| Tier / Role | Token | Value |
| --- | --- | --- |
| sm trigger | --control-height-sm | 32px height |
| md trigger | --control-height-md | 40px height |
| lg trigger | --control-height-lg | 48px height |
| List hairline | --border-width-1 / --border | 1px bottom border |
| Active rule | --border-width-4 / --primary | 4px bottom rule on active trigger |

## Code

```tsx
import {
  Tabs,
  TabsContent,
  TabsList,
  TabsTrigger,
} from "@freshgemui/monoplinth";

export function Example() {
  return (
    <Tabs defaultValue="overview">
      <TabsList>
        <TabsTrigger value="overview">Overview</TabsTrigger>
        <TabsTrigger value="tokens">Tokens</TabsTrigger>
      </TabsList>
      <TabsContent value="overview">Overview content</TabsContent>
      <TabsContent value="tokens">Token table</TabsContent>
    </Tabs>
  );
}
```

## Do and don't

- **Do: Keep tab labels concise and in a single horizontal row** — Use 1–2 word labels so triggers remain scannable without wrapping across lines.
- **Don't: Use Tabs for top-level page navigation** — Do not use Tabs when each view has its own URL route; use Link elements inside a navigation landmark instead.

## Accessibility

- `ArrowLeft`, `ArrowRight`, `Home`, and `End` move focus between enabled triggers.
- Focus ring renders on `:focus-visible` only using `2px` `--ring` with `2px` offset.
- Active state pairs `4px` `--primary` bottom border with `--foreground` text so selection does not rely on color alone.

## Rationale

Matching `TabsList` heights to `--control-height-{sm,md,lg}` and marking active triggers with a `4px` architectural rule aligns tab bars with form controls and section headers.
