ConfirmDialogElement
<vaadin-confirm-dialog> is a Web Component for showing alerts and asking for user confirmation.
<vaadin-confirm-dialog cancel-button-visible>
There are unsaved changes. Do you really want to leave?
</vaadin-confirm-dialog>Styling
The following shadow DOM parts are available for styling:
| Part name | Description |
|---|---|
backdrop | Backdrop of the overlay |
overlay | The overlay container |
content | The overlay content |
header | The header element wrapper |
message | The message element wrapper |
footer | The footer element that wraps the buttons |
cancel-button | The "Cancel" button wrapper |
confirm-button | The "Confirm" button wrapper |
reject-button | The "Reject" button wrapper |
The following custom CSS properties are available for styling:
| Custom CSS property |
|---|
--vaadin-confirm-dialog-max-width |
--vaadin-confirm-dialog-min-width |
--vaadin-dialog-background |
--vaadin-dialog-border-color |
--vaadin-dialog-border-radius |
--vaadin-dialog-border-width |
--vaadin-dialog-padding |
--vaadin-dialog-shadow |
--vaadin-dialog-text-color |
--vaadin-dialog-title-color |
--vaadin-dialog-title-font-size |
--vaadin-dialog-title-font-weight |
--vaadin-dialog-title-line-height |
--vaadin-overlay-backdrop-background |
Use confirmTheme, cancelTheme and rejectTheme properties to customize buttons theme.
See Styling Components documentation.
Custom content
The following slots are available for providing custom content:
| Slot name | Description |
|---|---|
header | Slot for header element |
cancel-button | Slot for "Cancel" button |
confirm-button | Slot for "Confirm" button |
reject-button | Slot for "Reject" button |
Properties
Sets the aria-describedby attribute of the dialog.
Whether to show cancel button or not.
Text displayed on cancel-button. This only affects the default button, custom slotted buttons will not be altered.
Theme for a cancel-button. This only affects the default button, custom slotted buttons will not be altered.
Text displayed on confirm-button. This only affects the default button, custom slotted buttons will not be altered.
Theme for a confirm-button. This only affects the default button, custom slotted buttons will not be altered.
Set to true to disable closing dialog on Escape press
Whether to show reject button or not.
Text displayed on reject-button. This only affects the default button, custom slotted buttons will not be altered.
Theme for a reject-button. This only affects the default button, custom slotted buttons will not be altered.