Package org.patternfly.component.alert


package org.patternfly.component.alert
Provides the PatternFly alert component for displaying notification messages to users.

Alerts are used to communicate the status of a system, feature, or page. They can appear inline on a page or as toast notifications via alert groups. PatternFly supports several alert variants including custom, info, success, warning, and danger, each with an associated status icon and color.

Usage

Basic alert variants:

Alert infoAlert = alert(info, "Info alert title");
Alert successAlert = alert(success, "Success alert title");
Alert warningAlert = alert(warning, "Warning alert title");
Alert dangerAlert = alert(danger, "Danger alert title");

Alert with description, actions, and close button:

Alert alert = alert(success, "Success alert title")
    .closable()
    .addDescription("This should tell the user more information about the alert.")
    .addActionGroup(alertActionGroup()
        .addAction("View details", (e, a) -> handleViewDetails())
        .addAction("Ignore", (e, a) -> handleIgnore()));

Inline alert group for static alerts:

AlertGroup group = alertGroup(staticInline)
    .addItem(alert(success, "Success alert").inline())
    .addItem(alert(info, "Info alert"));
See Also:
  • Class
    Description
    An alert is a notification that provides brief information to the user without blocking their workflow.
     
     
    An alert group stacks and positions 2 or more alerts in a live region, either in a layer over the main content of a page or inline with the page content.