Alert Dialog
A modal alert dialog for important user confirmations. Click the button to open the dialog.
Additional Documentation
Alert dialog for confirming or canceling actions.
Clicking on the outside or pressing the escape key will close the dialog and that counts as canceling.
Important
The surrounding page must have an element with the id modal-root, this dialog will be teleported to it, so it can properly be over all other content. The modal-root should be somewhere near the end of the page structure.
Slot default is used as the content of the alert, and also becomes the ARIA description of the alert.
Props
type Props = {
/**
* Dialog label
*/
label?: string;
/**
* Accept button text
*/
buttonText?: string;
/**
* Accept button color
*/
buttonColor?: "primary" | "secondary" | "danger";
}Result: