Skip to content

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.

WARNING

This feature requires a parent Root component to function correctly, as it is responsible for rendering the alert.

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;
};

Used components