Confirm dialogs are used to interrupt the user and require an explicit "Confirm" or "Cancel" action. These are essential for destructive actions like deletions or major configuration changes.Usage#
Unlike toasts, embedded.ui.confirm returns a Promise that resolves with the user's choice.Options#
The confirm method accepts a configuration object:| Option | Type | Default | Description |
|---|
| title | string | - | The title of the dialog. |
| message | string | - | The body text explaining the action. |
| confirmText | string | "Confirm" | Text for the confirmation button. |
| cancelText | string | "Cancel" | Text for the cancellation button. |
| variant | string | "info" | Visual style: "info", "warning", or "danger". |
Return Value#
The method returns a Promise<ConfirmResult>:Use Danger Variant for Deletions: Always use variant: "danger" for destructive actions to visually warn the user.
Clear Consequences: The message should clearly state what will happen if the user confirms.
Keep it Action-Oriented: Use button text like "Save Changes" or "Delete" instead of just "Yes" or "No".
Modified at 2026-02-12 08:53:55