Alerts inform users that something important has happened on the page. They need to be assertive and important messages with the intent to interrupt the user flow, even if not page blocking. They may communicate a critical error or request additional required input from our users.
Persistent Alert Notifications provide brief, critical responses to changes in a page's data or user state. Their job is to keep users informed of important system or time-sensitive changes. These messages are displayed inline and are normally in close relation to the elements needing the user's attention.
As with other notifications, Alert Notifications are not provided as part of a page's content. Because of their assertive nature, Alert Notifications should be used sparingly and reserved for situations where the user's immediate attention is required. Dynamic notifications that are less urgent should use one of the appropriate Status Notification types.
Priority
Prominent, high priority
Expectancy
Unexpected
Purpose
The application has made updates
There are application failures, such as a lost connection to the server where local changes will not be saved
The user is required to make a time-sensitive interaction
Interaction
Non-blocking, most often inline, required
Information
Critical or time-sensitive errors and warnings
Location
Inline on page, generally located in associated section of effected content
Options
May auto-dismiss once the originating cause has been resolved
May provide anchors directing users to error origin
Providing errors, warnings, or success messaging related to user-entered formatting, incomplete inputs, or invalid selections (see Validation Notifications)
Page usage needs to be blocked until the user takes an action within the message or exits (see User Confirmation Alerts)
User interaction is required or content is critical to the user flow (see Modal)
The message contains a rich UI experience (see Modal)
The user makes a selection that does not add or change content to the page
Providing the only indication of an error, if needing to alert users on how to resolve the problem
Using an alert rather than a status notification within form field validation. While not invalid, this may cause confusion to some users of assisted technology as it may read over the current or next form field label. It may be helpful however to use role alert to represent a validation summary which would populate after a user attempts to submit the form.
Make the relationship between page controls and the notification explicit with the aria-controls attribute if another part of the page controls what appears in the alert
Should not
Reuse bespoke UI intended for other message or navigation types
May
Auto-dismiss once originating cause has been resolved
Display notifications in unique UI to create distinction around themselves and the the page content
Update a live region of the page
Use the HTML <aside> tag, denoting the section that, though related to the main element, doesn't belong to the main flow
These alerts require the user to interact with additional options provided within the message and request user confirmation of a task or process initiated by the user or the application itself.
Priority
Prominent, high priority
Expectancy
Unexpected
Purpose
The user must confirm a requested action
The user must agree to terms and conditions
The user must acknowledge a change or condition that will effect the page
The user is presented with a required option that is page blocking
The alert provides context to the page or page section (see Alert Notifications)
Providing errors, warnings, or success messaging related to user entered formatting, incomplete inputs, or invalid selections (see Validation Notifications)