# Tabs

Views of the same thing, one at a time, with the whole keyboard model.

Group: Overlays. Code: `components/software/overlay.tsx`. From the old system: Tabs in @id-identity-as/ui/overlay. Live: https://design.id-hub.dk/software/tabs

```tsx
import { Tabs } from '@/components/software/overlay';

<Tabs
  label="Vis ordren som"
  items={[
    { id: 'lines', label: 'Linjer', content: <Table ... /> },
    { id: 'history', label: 'Historik', content: <Text>...</Text> },
  ]}
/>
```

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| label (required) | `string` |  | The name of the tab list, read aloud. |
| items (required) | `TabItem[]` |  | { id, label, content }. |
| defaultSelectedKey | `string` |  | The tab shown from the start, uncontrolled. Defaults to the first. |
| selectedKey | `string` |  | The tab shown. With onSelectionChange the tabs are controlled. |
| onSelectionChange | `(key: string) => void` |  | Called with the id of the new tab. |

Do:
- Use tabs for views of one thing: the lines and the history of an order.
- Keep the labels to a word or two.
- Control it and keep the choice in the address when a tab should be shareable.

Do not:
- Do not use tabs for navigation between pages. That is Navigation.
- Do not let the tab list wrap. It scrolls sideways.

Accessibility:
- The ARIA tabs pattern: arrow keys move along the list, Home and End jump to the ends.
- Only the chosen tab is in the tab order, and each panel is tied to its tab and can take focus.

Tokens it uses:
- color.border.default
- color.text.default
- color.text.muted
- type.body.md
- space.inline.3
- space.inline.4

---

Not drawn in Figma. Kasper decided on 20 November 2026 that internal software gets this set now, built only from the tokens. The look is ours until Peter draws it, and every open choice is a question in docs/SPOERGSMAAL-TIL-PETER.md. The public site, campaigns and brand surfaces use only the components drawn in Figma.

The rules for this set and all 33 components: https://design.id-hub.dk/software.md. Token values: https://design.id-hub.dk/tokens.md.

Index of everything, as text: https://design.id-hub.dk/llms.txt. Never invent a colour, a size, a component or a product fact: if it is not here, it does not exist yet.
