# FlashMessage

What the page says about the thing you just did. In the flow, not a toast.

Group: Status and waiting. Code: `components/software/message.tsx`. From the old system: FlashMessage in @id-identity-as/ui/commerce. Live: https://design.id-hub.dk/software/flash-message

```tsx
import { FlashMessage } from '@/components/software/message';

<FlashMessage title="Ordren er gemt">Antal ændret fra 24 til 48.</FlashMessage>
<FlashMessage tone="alert" title="Ordren blev ikke gemt">Prøv igen, eller kontakt support.</FlashMessage>
```

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| title (required) | `string` |  | What happened, as a short sentence. |
| tone | `'status' \| 'alert'` | `'status'` | Status is news that can wait its turn. Alert interrupts, for when something failed. |
| id | `string` | `'besked'` | A stable id, so the page that follows an action can send focus to the message. |
| action | `ReactNode` |  | One way on from here, such as a link. |
| children | `ReactNode` |  | The detail under the title. |

Do:
- Place it at the top of the content, and leave it until the next navigation.
- Send focus to it after a redirect, so the outcome is the first thing read.
- Use alert only when something failed and the reader must act.

Do not:
- Do not make it disappear on a timer. A confirmation gone before it is read was never given.
- Do not float it over the page as a toast.
- Do not colour an alert red. It is marked by a doubled edge in the text colour.

Accessibility:
- role="status" is read when the reader is free; role="alert" interrupts.
- It can take focus from script (tabindex -1) without joining the tab order.

Tokens it uses:
- color.surface.base
- color.border.default
- color.text.default
- radius.sm
- type.heading.md
- type.body.md
- space.inline.1
- 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.
