Components / Overlays

AlertDialog macro

A modal that asks for a confirmation and ignores clicks outside; fires confirm or cancel.

Built from
BoxButtonDialog
Children
many
Loading the renderer…
AlertDialog rendered by the React renderer on Web
Web React
AlertDialog rendered by the SwiftUI renderer on iOS
iOS SwiftUI
AlertDialog rendered by the Compose renderer on Android
Android Compose
AlertDialog rendered by the gpui renderer on Desktop
Desktop gpui

View exponential-ui-alert-dialog, painted by each native renderer.

PropTypeDefaultDescription
titlerequiredstring–The question.
descriptionstring–What will happen.
confirmLabelstring"$string.confirm"The confirming button's text.
cancelLabelstring"$string.cancel"The cancelling button's text.
destructivebooleanfalseStyles the confirming button as dangerous.
openbindbooleanfalseWhether it shows; bind it.
NameKind
on.confirmevent: runs an action
on.cancelevent: runs an action
on.changeevent: runs an action
triggerslot: one component by id
Role
alertdialog
Semantics
alertdialog. The cancel button takes focus on open (autoFocus, $a11y).
KeysAction
–Opening focuses the cancel button
Escapecancel; clicks outside are ignored
Recipe parts
AlertDialog/rootAlertDialog/footerAlertDialog/cancelAlertDialog/confirm
Keyed by
destructive:hover:pressed:focus:disabled:checked:open:selected:invalid:dragover

Themes · Write a theme