On this page
@addTagHelper *, Webority.Ui.RazorDestructive confirm
Set the danger tone for anything that removes or destroys data, so the weight of the action is unmistakable.
Type to confirm
Use a typed phrase for the highest-stakes actions, so Confirm stays locked until the exact text is entered.
Neutral and plain
Leave the danger tone off for a reversible action, and use plain for a quick confirm inside a working screen.
Illustration and icon size
Use your own artwork when the tone artwork does not fit, and set a pixel size to resize the badge.
Loading
Set loading while the confirmed action runs, so Confirm and Cancel lock and the dialog stays open.
Ask from anywhere
Ask a yes or no question from any part of the page, without placing a dialog in the markup.
Every option
Every value of every prop, one cell each.
id and open: how the dialog shows
open (React only): true while the dialog shows, set by the trigger
id: a trigger opens the dialog by naming this id
title: the dialog heading
title="Delete this project?"
description: the consequence text
description="It leaves the list."
variant: default or plain
variant="default" (default)
variant="plain"
confirm and cancel labels: custom copy
confirm-label="Delete forever"
cancel-label="Never mind"
tone: every value
tone="success"
tone="danger"
tone="warning"
tone="info"
tone="primary"
tone unset (default): the info icon
unknown tone: not a tone, so the valid set is the five above
icon: replaces the tone glyph
icon="trash"
icon="log-out"
icon="warning-2"
icon as a node (React only): a node is drawn as given
iconSize: illustration size in px
icon-size="48"
icon-size unset (default): 120px with a message
image: any source size, one footprint
image (512px source)
image (40px source)
image, no message
image + tone danger
confirmPhrase: type-to-confirm gate
confirm-phrase="acme-corp" (locked until typed)
typePhraseLabel: the built-in text, replaced
type-phrase-label (default): "Type {phrase} to confirm"
type-phrase-label="Saisissez {phrase} pour confirmer"
loading, static backdrop and placement
loading="true" (spinner, everything locked)
static-backdrop="true" (default): a backdrop click and Escape leave it open
static-backdrop="false": a backdrop click and Escape close it
placement="center" (default)
placement="top"
size: card width (preset or custom px)
size="sm"
size="md" (default)
size="lg"
size="xl"
size="720" (custom px)
confirm href: the confirm button as a link
confirm-href="#": the confirm button links to a URL
onConfirm and onClose: what runs on confirm and dismiss
onConfirm (React only): Razor's confirm button carries data-app-confirm to wire up
onClose (React only): Razor's Cancel closes the dialog
className: extra classes on the dialog
className (React only): merged onto the dialog's own classes
Guidance
What to do, and what to avoid.
Use it when
- A destructive action needs a deliberate second step: delete, remove, cancel.
- An action is irreversible and you want the user to pause before it runs.
- The stakes are high enough to warrant typing an exact phrase to unlock (confirmPhrase).
Reach for something else when
- The dialog holds a form or details, not a yes/no question. → AppModal
- The action is trivial and easily undone. → an inline action + undo toast
- You're confirming across a slide-in panel of options. → AppDrawer
Name the verb and use danger
The danger tone + a verb-labelled button ("Delete") makes the weight and the outcome of the action clear.
A neutral "OK" on a destructive confirm hides what pressing it actually does.
Typed name only for irreversible actions
For an account-wide wipe, confirmPhrase forces the user to type the name, so there are no accidental clicks.
Gating a reversible archive behind a typed phrase is friction with no payoff, so save it for the irreversible.
Reference
Try every prop, read the full list, and check keyboard and screen reader behaviour.
18 props. The 4 most used come first.
Used on most screens 4 props
| Prop | Type | Default | Description |
|---|---|---|---|
| titledefault - | string | - | The dialog heading. |
| descriptiondefault - | string | - | The consequence: what happens if the user confirms. Inner content overrides it. |
| confirm-labeldefault Confirm | string | Confirm | The confirm button's text. |
| tonedefault - | Success | Danger | Warning | Info | Primary | - | The status icon, and the confirm button's colour when danger: the danger tone styles Confirm as destructive and draws the delete icon. Unset, the icon is info. |
Less common 14 props
| Prop | Type | Default | Description |
|---|---|---|---|
| iddefault - | string | - | The dialog id. A trigger button opens the dialog when it names this id. |
| cancel-labeldefault Cancel | string | Cancel | The cancel button's text. |
| confirm-hrefdefault - | string | - | If set, the confirm button is a link to this URL; otherwise a plain button carrying data-app-confirm to wire up. |
| icondefault - | string | - | Replaces the tone's glyph with the named icon. An image still wins over it. |
| icon-sizedefault - | int | - | Width and height of the illustration in px, for the tone artwork and a custom image alike. Unset, it is 120px with a message and 84px without. |
| imagedefault - | string | - | URL of a custom illustration that replaces the tone artwork. Any source size is fine: the theme boxes it to the same footprint. It is decorative, so the title and message carry the meaning. |
| variantdefault default | Default | Plain | default | default keeps the status illustration and equal-width actions. plain drops the illustration, starts the text at the edge and sizes the actions small, right-aligned. |
| confirm-phrasedefault - | string | - | Exact text the user must type before Confirm unlocks, such as a workspace name. |
| type-phrase-labeldefault Type {phrase} to confirm | string | Type {phrase} to confirm | Replaces the built-in English text, for other languages. {phrase} is filled with the confirm phrase. |
| loadingdefault false | bool | false | Busy state: shows a spinner and disables Confirm, Cancel and the confirm-phrase field, and blocks dismissal while the async action is in flight. |
| static-backdropdefault true | bool | true | The dialog closes only through its own Cancel or Confirm by default. false lets Escape and an outside click close it. |
| placementdefault center | Center | Top | center | Vertical placement of the card: centred, or pinned near the top. |
| sizedefault md | Sm | Md | Lg | Xl | md | Card width: a preset. |
| size-pxdefault - | number | - | The card width in px, instead of a preset. |
Screen reader
6 notes- The dialog is built on AppModal, so it traps focus, closes on Escape only when staticBackdrop is false, and restores focus.
- The title is an h3 that takes focus when the dialog opens.
- A custom image is hidden from assistive technology with an empty alt, so the title and message carry the meaning.
- The confirm-phrase field is named "Type <phrase> to confirm", and Confirm stays disabled until the phrase matches.
- While loading, Cancel is disabled and the backdrop and Escape no longer close the dialog.
- Children draw left-aligned between the description and the confirm-phrase field, so a field placed there keeps its own label.
Do and avoid
2 pairsName the verb and use danger
The danger tone + a verb-labelled button ("Delete") makes the weight and the outcome of the action clear.
A neutral "OK" on a destructive confirm hides what pressing it actually does.
Typed name only for irreversible actions
For an account-wide wipe, confirmPhrase forces the user to type the name, so there are no accidental clicks.
Gating a reversible archive behind a typed phrase is friction with no payoff, so save it for the irreversible.