# Dialog

A question that must be answered before the work goes on.

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

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

<Dialog
  open={open}
  onClose={() => setOpen(false)}
  title="Bekræft ordren"
  description="Antal kan stadig ændres bagefter."
  footer={
    <Actions align="end">
      <Button variant="outline" onClick={() => setOpen(false)}>Annullér</Button>
      <Button onClick={confirm}>Bekræft</Button>
    </Actions>
  }
>
  ...
</Dialog>
```

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| open (required) | `boolean` |  | Whether the dialog is shown. The page owns this state. |
| onClose (required) | `() => void` |  | Called when the dialog closes: the close button, the Escape key or a click outside. |
| title (required) | `string` |  | The name of the dialog, read aloud when it opens. |
| hideTitle | `boolean` | `false` | Hides the title from the eye, when the content is its own heading. |
| description | `string` |  | A line under the title. |
| footer | `ReactNode` |  | The foot of the dialog, usually Actions with the buttons. |
| closeLabel | `string` | `'Luk'` | The name of the close button. |

Do:
- Use it for a decision that cannot wait: confirm, discard, choose.
- Write the title as the question and the buttons as the answers.
- Put the outline action first and the solid one last in the footer.

Do not:
- Do not open a dialog from a dialog.
- Do not use it for a message that needs no answer. That is FlashMessage.
- Do not use it on the public site. A dialog there waits for Figma.

Accessibility:
- The native dialog element, opened as a modal: focus is kept inside, Escape closes it, and the page behind is inert.
- Named by its title and described by its description.
- The close button is an icon with a name.

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