Skip to content

DLG-005 Give the destructive button the danger style, also when the person asked for the action

Level
Guideline, our choice
Verdict
Split (1 of 2)
Status
decided, version 1.0.3

Rule

In a dialog that asks the person to confirm a destructive action, give the destructive button the danger style, even when the person has just asked for that action. Its label still names the action, as DLG-003 says, so colour is never the only sign of danger.

Examples

Live examples built with Justified's components. Try them with the mouse, the keyboard or a screen reader.

Do: The destructive button is red

Invoices

  • 2026-0412 · Lindqvist Bakery · $1,240
  • 2026-0413 · North Pier Studio · $380
  • 2026-0414 · Hale & Daughters · $2,015

Press Delete on a row. The person asked for it, and Delete invoice is still red, with Cancel in outline. The colour is a last cue that the wrong row may be about to go, and the label says the same in words.

Don't: Drawn like any main button

Invoices

  • 2026-0412 · Lindqvist Bakery · $1,240
  • 2026-0413 · North Pier Studio · $380
  • 2026-0414 · Hale & Daughters · $2,015

Delete invoice looks just like Save elsewhere in the product. Nothing in its look says that this step erases something for good.

Don't: Cancel styled as the main button

Invoices

  • 2026-0412 · Lindqvist Bakery · $1,240
  • 2026-0413 · North Pier Studio · $380
  • 2026-0414 · Hale & Daughters · $2,015

Cancel is filled, to steer people away from deleting, while Delete invoice stays red. The styles now push towards the answer the product prefers, and the safe choice looks like the main one.

Why

A red button says "stop and look" before the words are read. In a confirmation dialog that is the last chance to notice that the wrong project, the wrong person or the wrong file is about to go. Colour alone is not enough, though. Some people cannot tell red from other colours, some use a high contrast mode that replaces it, and a screen reader does not announce it. The label has to carry the same meaning, which is why this rule leans on the naming in DLG-003. WCAG 2.2, 1.4.1 Use of Color does not ask for a red button. It does mean that if the red signals danger, something else must signal it too, and the label is that something. The text on a red button must also be easy to read against it, under 1.4.3 Contrast (Minimum).

Our reasons

The judges are split on this, so we chose. We use the danger style on every destructive confirmation, also when the person asked for the action, for three reasons.

  • A last warning before a loss. Asking for something and seeing what it will do are not the same. The person chose Delete a moment ago, perhaps on the wrong row. The colour is one more cue at the only point left where that slip can be caught. Once the action has run, there is nothing left to warn about.
  • One colour, one meaning. Justified's Button has a destructive variant for actions that destroy something. The confirmation dialog is where that action finally runs. Leaving the variant out there would weaken its meaning in the one place it matters most.
  • The label carries the meaning anyway. The colour is an extra for those who can see it. People who cannot get the same warning from the words Delete project, so nobody depends on the red alone.

Do

  • In "Delete the project Autumn 2026?", Delete project uses variant="destructive" and Cancel uses variant="outline".
  • The person picks Delete on a row in a list of invoices, and a dialog asks "Delete invoice 2026-0412?". Delete invoice is red, even though they asked for it.
  • Let the title and the button name the same action, so the warning is in the words as well as the colour.
  • Use Justified's destructive tokens as they are. The contrast of the button's text against its red is tested in the light and the dark theme. If you change the colours, check the text again against 1.4.3, as VIS-001 describes, and keep each token on the fill it was made for, as VIS-002 asks.
  • Add an icon such as a bin next to the label if you like. The text still carries the meaning; the icon is an extra.

Don't

  • Show a red button labelled OK or Yes. The colour warns, but the words do not say of what.
  • Draw Delete project in the same style as Save because the person asked for it.
  • Make Cancel red, or use red for an action that destroys nothing, such as Send. Red that shows up everywhere stops warning.
  • Style Cancel as the main, filled button to steer people away from deleting. Focus starts on it, as DLG-004 says, but that is a safe place to start, not an answer chosen for them.
  • Signal the danger only with a red border or a red icon, with no words that say what will be lost.
  • Fade or tint the red button while it can be pressed, so its text no longer reaches the contrast the tokens are tested for. While it is unavailable, for example until the project's name is typed as DLG-003 describes, the faded look of a disabled Button is fine, and ACT-005 says what text goes before it.

Exceptions

  • Actions the person asked for. These are not an exception. They are the case this rule is written for.
  • Actions that can be undone. When an action can be undone at once and no dialog is shown, this rule does not apply.
  • Labels and focus. What the buttons say is covered by DLG-003. The red button never takes focus when the dialog opens, as DLG-004 says.

Verdict

Split (1 of 2). Only the judges decide; the expert witnesses are shown but do not vote. The judges do not settle this one, so it is a guideline: our own choice, with our reasons above. How verdicts work

Stances on DLG-005
SourceRoleStancePage
WCAG 2.2LawSupports1.4.1 Use of Color
WCAG 2.2LawSupports1.4.3 Contrast (Minimum)
Material DesignJudge No position
Apple Human Interface GuidelinesJudge OpposesAlerts
Carbon Design SystemJudge SupportsModal: usage
Button: usage
GOV.UK Design SystemExpert witness SupportsButton
Nielsen Norman GroupExpert witness No position

Each stance links to the page it rests on, read on the date in the source register. This page never repeats what a source says; read the source itself.

History

  • Version 1.0.3, : Points to VIS-001 for text contrast and VIS-002 for token pairs.
  • Version 1.0.2, : Narrowed to the danger style. The label is DLG-003's rule and is only referred to here.
  • Version 1.0.1, : Examples in English.
  • Version 1.0.0, : First version.

Last checked against the other rules for conflicts on .

More in Dialogs: 5 rules and 2 guidelines · All rules