Skip to Content
Overlays & Dialogs@hacline/ui/alert-dialog

AlertDialog

Collect user confirmation before executing a critical or irreversible action.

Usage

"Keep draft" and "Confirm clear" each update the demo state. A close button's value is passed as returnValue to the open state callback.

Draft saved

Async Confirmation

Return a Promise from the confirm button's action. The button displays a pending state while archiving, and the dialog closes once the operation completes.

Parts

PartDescriptionExtended Props
AlertDialogBackdrop
A dim behind the alert dialog. Pressing it does nothing.
variant
AlertDialogClose
A button that closes the alert dialog, like Cancel or Delete. An action runs first, and a Promise it returns keeps the alert dialog open until it settles.—
AlertDialogContent
The alert dialog itself, with the alertdialog role, named by its title. Put the title, the description and the buttons that answer it inside.
size
AlertDialogDescription
Describes the alert dialog while it's rendered. A paragraph by default.—
AlertDialogShortcut
Shows a trigger's shortcut inside the trigger.—
AlertDialogTitle
The alert dialog's title, which names it. A level 2 heading by default.—
AlertDialogTrigger
The button that opens the alert dialog. A trigger outside the alert dialog connects through controller.—

Props

Prop

Type

View UI SDK parts and state attributes.