Alert
This function displays an alert with the specified properties and waits for the alert to be closed before resolving the promise.
Alert
Unexpected error occurred. Please try again or contact support if the issue persists.
TIP
Alerts can interrupt the user by taking over the entire screen. Consider using a Notice or Snackbar for less intrusive notifications.
Requires FluxRoot
Alerts render through a parent <FluxRoot>. Without one in your app, nothing appears and no error is thrown.
Required icons
circle-check
Functional API
Alerts can only be shown from code. An Overlay should be used if you want to show an alert from within your template.
ts
showAlert({
icon: 'circle-exclamation',
title: 'Title',
message: 'Hello world'
});ts
function showAlert(spec: FluxAlertObject): Promise<void> {
}ts
type FluxAlertObject = {
readonly id: number;
readonly icon?: FluxIconName;
readonly message: string;
readonly title: string;
onClose(): void;
};