# ErrorSummary

What a rejected form says first: every problem, each a link to its field.

Group: Forms. Code: `components/software/form.tsx`. From the old system: ErrorSummary in @id-identity-as/ui/form. Live: https://design.id-hub.dk/software/error-summary

```tsx
import { ErrorSummary } from '@/components/software/form';

<ErrorSummary
  title="Ret 2 felter"
  errors={[
    { id: 'email', message: 'Skriv en e-mailadresse' },
    { id: 'cvr', message: 'CVR-nummeret skal have otte cifre' },
  ]}
/>
```

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| title (required) | `string` |  | The heading, such as "Ret 2 felter". Written by the page, so it can be translated and counted. |
| errors (required) | `Array<{ id: string; message: string }>` |  | One line per field: the id of the field and what to do. An empty list renders nothing. |
| id | `string` | `'error-summary'` | A stable id, so the form can send focus here. |

Do:
- Place it first in the form.
- Send focus to it when the form comes back with errors.
- Repeat each message on its field with the error prop.

Do not:
- Do not use it for what the browser already validates before the form posts.
- Do not colour it red. The doubled edge marks it.

Accessibility:
- role="alert", and it can take focus from script (tabindex -1).
- Every message is a link to its field, so one press moves there.

Tokens it uses:
- color.text.default
- radius.sm
- type.heading.md
- type.body.md
- space.inline.2
- space.inline.3
- space.inline.5

---

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.
