Confirm Button
A Button that opens an AlertDialog for confirmation before firing OnConfirm — replaces the boilerplate of wiring a Button and AlertDialog by hand.
When to Use
- Destructive actions (delete, remove, discard) that need a confirmation step
- Commit-changes flows where an accidental click would be costly
- Anywhere you would otherwise hand-wire a Button plus an AlertDialog and its open state
ConfirmButton renders the confirmation through OverlayService, so the dialog is rendered by the central OverlayProvider — no extra dialog markup ends up in your component tree.
API Reference
ConfirmButton
| Property | Type | Default | Description |
|---|---|---|---|
| ChildContent | RenderFragment? | — | The visible button content (label or icon). |
| Title | string? | "Are you sure?" | Heading shown at the top of the confirm dialog. |
| Description | string? | — | Optional explanatory body text under the title. |
| ConfirmText | string? | "Continue" | Label for the confirm action button in the dialog. |
| CancelText | string? | "Cancel" | Label for the cancel action button in the dialog. |
| IsDestructive | bool | false | Styles the dialog confirm button as destructive (red). |
| OnConfirm | EventCallback | — | Fires after the user confirms. Does not fire on cancel. |
| OnCancel | EventCallback | — | Fires when the user cancels or dismisses the dialog without confirming. |
| Variant | Button.ButtonVariant | Default | Visual variant of the trigger button. Often set to Destructive for delete actions. |
| Size | Button.ButtonSize | Default | Size of the trigger button. |
| Disabled | bool | false | Disables the trigger button. |
| IsLoading | bool | false | Shows the button's loading state. |
| Class | string? | — | Additional CSS classes forwarded to the trigger button. |
Related Components
- AlertDialog — The modal dialog ConfirmButton opens under the hood
- PopConfirm — Lightweight inline popover confirmation instead of a modal
- Button — The underlying trigger; ConfirmButton accepts the same Variant / Size
- Overlay Service — The service that renders the confirmation dialog