Using ARIA role=status

Metadata

ID: W##

Technology: ARIA

Type: Technique

When to Use

This technique relates to:

Description

The purpose of this technique is to notify Assistive Technologies (AT) when content has been updated with information about the user's or application's status. The aria live region role of status has an implicit aria-live value of polite, which allows a user to be notified via AT (such as a screen reader) when status messages are added. The role of status also has an aria-atomic value of true, so that updates to the region marked with a role of status will result in the AT presenting the entire contents of the region to the user, including any author-defined label. The content within the aria-live region is automatically read by the AT, without the AT having to focus on the place where the text is displayed. See WAI-ARIA 1.1 status (role) for more details.

Examples

Copy the following section for each example. Examples must have a title and a description, and usually have a code sample. Code samples should be elided if necessary to show the core of the technique without necessarily providing all the surrounding code that would also be involved. A working example link references a location where the technique can be shown working live.

Including a search results message

After a user presses a Search button, the page content is updated to include the results of the search, which are displayed in a section below the Search button. The change to content also includes the message "5 results returned" near the top of this new content. This text is given an appropriate role for a status message. A screen reader will announce "Five results returned".

						

5 results returned.

Working example: link

Updating the shopping cart status

After a user presses an Add to Shopping Cart button, a section of content near the Shopping Cart icon updates the text to read "6 items". The div containing this text is marked with the role of status. Because the shopping cart icon adds visual context, a label is added with aria. A screen reader will announce "Shopping cart, six items".

						
							
6 items

Working example: link

Tests

Procedure

  1. Determine if text that meets the definition of a status message appears on the page.
  2. Determine if the container for the text is given a role of "status".

Expected Results