Alert messages
Summary
Principle
Alert messages are a special case of notification messages that are used to report a critical error or warning.
They grab the reader’s attention through a short message that is displayed all at once on the screen, without reloading the page or interrupting the activity.
This code is based on the “Alert” design pattern found in ARIA Authoring Practices Guide (APG) of the W3C.
Core HTML base
When the page is loaded
When the alert is triggered
ARIA roles, states and properties
The role="alert"
attribute must be applied to the container of the alert message.
Expected behavior
The role="alert"
attribute must be statically present when the page is loaded.
This container must then be dynamically populated when the alert is triggered.
Note
Alert messages must not disappear automatically from the screen after a certain time.
They must disappear only following a deliberate action by the user (closing “X”, display of a new page, etc.).