Confirm Dialog
aka Destructive Confirm · Alert Dialog
A compact modal that confirms a destructive action. Names the consequence in the title, not the button.
When to use
Delete, archive, leave-team, transfer-ownership. Anything irreversible.
Anatomy
- Title. Names the consequence
- Body. What happens after, in plain language
- Cancel (secondary, left)
- Destructive primary (right, danger color)
- Focus trap + Esc to close + initial focus on Cancel
How the industry does it
3 examples · credited
Prompt
Build a destructive confirm dialog using Radix Dialog or a comparable headless primitive. 400px wide, 24px padding, rounded-xl, with a soft backdrop (no harsh black). Title in 17px medium that names the consequence ('Delete project Atlas?'). Below: 14px muted paragraph describing irreversibility. Footer with two buttons - left: ghost 'Cancel' (initial focus); right: destructive solid red 'Delete project'. Focus trap, Esc to dismiss, click outside to dismiss only on non-destructive variants. Honour prefers-reduced-motion (fade only, no scale).Polish & tuning
2 of 4 unlockedMotion
Ease-out for entrance, ease-in-out for state. 200ms hover, 400–600ms layout. Stagger children at 30–60ms so groups feel intentional, not synchronized.
Spacing
Pick one scale (4 or 8) and don't mix. Section padding 96–128px desktop, 48–64px mobile. Headline sits ~24px above the subhead; subhead ~32px above the CTA cluster.