# Stack

Rhythm as a decision: one gap between the children, taken from the spacing steps.

Group: Layout. Code: `components/software/layout.tsx`. From the old system: Stack in @id-identity-as/ui/layout. Live: https://design.id-hub.dk/software/stack

```tsx
import { Stack } from '@/components/software/layout';

<Stack gap="section-1">
  <Heading level={1}>Ordrer</Heading>
  <Stack gap="inline-3">
    <Text>24 åbne ordrer.</Text>
    <Text tone="muted">Opdateret i dag.</Text>
  </Stack>
</Stack>
```

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| gap | `Space` | `'inline-4'` | The space between the children: 'none', 'seam', 'inline-1' to 'inline-5' or 'section-1' to 'section-4'. |
| direction | `'column' \| 'row'` | `'column'` | Column stacks downwards. Row sets the children side by side and wraps. |
| align | `'start' \| 'center' \| 'end' \| 'stretch'` | `'stretch'` | How the children sit across the direction. |
| as | `ElementType` | `'div'` | The element to render, such as "ul" or "section". |

Do:
- Use an inline step inside a group and a section step between groups.
- Nest stacks: a section stack of groups, each an inline stack.

Do not:
- Do not put a margin on a child to adjust the rhythm. Change the gap.
- Do not look for a step between 20 and 40 px. There is none.

Accessibility:
- It adds no role. Pass as="ul" or as="section" when the content is a list or a region.

Tokens it uses:
- space.inline.1
- space.inline.2
- space.inline.3
- space.inline.4
- space.inline.5
- space.section.1
- space.section.2
- space.section.3
- space.section.4
- space.seam

---

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.
