These are opportunities to improve the usage of ARIA in your application which may enhance the experience for users of assistive technology, like a screen reader.
You don’t always need aria-
attributes in your application for it to be accessible. When you do use aria-
attributes follow these recommendations to make sure they are helpful.
Contains:
-
[aria-*]
attributes match their roles: Each ARIArole
supports a specific subset ofaria-*
attributes. Mismatching these invalidates thearia-*
attributes. -
Uses ARIA roles only on compatible elements: Many HTML elements can only be assigned certain ARIA roles. Using ARIA roles where they are not allowed can interfere with the accessibility of the web page.
-
button
,link
, andmenuitem
elements have accessible names: When an element doesn’t have an accessible name, screen readers announce it with a generic name, making it unusable for users who rely on screen readers. -
ARIA attributes are used as specified for the element’s role: Some ARIA attributes are only allowed on an element under certain conditions.
-
Deprecated ARIA roles were not used: Deprecated ARIA roles may not be processed correctly by assistive technology.
-
Elements with
role="dialog"
orrole="alertdialog"
have accessible names: ARIA dialog elements without accessible names may prevent screen readers users from discerning the purpose of these elements. -
[aria-hidden="true"]
is not present on the document<body>
: Assistive technologies, like screen readers, work inconsistently whenaria-hidden="true"
is set on the document<body>
. -
[aria-hidden="true"]
elements do not contain focusable descendents: Focusable descendents within an[aria-hidden="true"]
element prevent those interactive elements from being available to users of assistive technologies like screen readers. -
ARIA input fields have accessible names: When an input field doesn’t have an accessible name, screen readers announce it with a generic name, making it unusable for users who rely on screen readers.
-
ARIA meter elements have accessible names: When a meter element doesn’t have an accessible name, screen readers announce it with a generic name, making it unusable for users who rely on screen readers.
-
ARIA progressbar elements have accessible names: When a
progressbar
element doesn’t have an accessible name, screen readers announce it with a generic name, making it unusable for users who rely on screen readers. -
Elements use only permitted ARIA attributes: Using ARIA attributes in roles where they are prohibited can mean that important information is not communicated to users of assistive technologies.
-
[role]s have all required [aria-*] attributes: Some ARIA roles have required attributes that describe the state of the element to screen readers.
-
Elements with an ARIA
[role]
that require children to contain a specific[role]
have all required children: Some ARIA parent roles must contain specific child roles to perform their intended accessibility functions. -
[role]s are contained by their required parent element: Some ARIA child roles must be contained by specific parent roles to properly perform their intended accessibility functions.
-
[role] values are valid: ARIA roles must have valid values in order to perform their intended accessibility functions.
-
Elements with the role=text attribute do not have focusable descendents: Adding
role=text
around a text node split by markup enables VoiceOver to treat it as one phrase, but the element’s focusable descendents will not be announced. -
ARIA toggle fields have accessible names: When a toggle field doesn’t have an accessible name, screen readers announce it with a generic name, making it unusable for users who rely on screen readers.
-
ARIA tooltip elements have accessible names: When a tooltip element doesn’t have an accessible name, screen readers announce it with a generic name, making it unusable for users who rely on screen readers.
-
ARIA treeitem elements have accessible names: When a
treeitem
element doesn’t have an accessible name, screen readers announce it with a generic name, making it unusable for users who rely on screen readers. -
[aria-*]
attributes have valid values: Assistive technologies, like screen readers, can’t interpret ARIA attributes with invalid values. -
[aria-*]
attributes are valid and not misspelled: Assistive technologies, like screen readers, can’t interpret ARIA attributes with invalid names. -
ARIA IDs are unique: The value of an ARIA ID must be unique to prevent other instances from being overlooked by assistive technologies.
Links href="#links"
- How to match ARIA attributes to their roles
- About ARIA roles
- How to make command elements more accessible
- About conditional ARIA attributes
- About deprecated ARIA roles
- How to make ARIA dialog elements more accessible
- How
aria-hidden
affects the document body - How
aria-hidden
affects focusable elements - About input field labels
- How to name
meter
elements - How to label
progressbar
elements - About prohibited ARIA roles
- About roles and required attributes
- About roles and required children elements
- About ARIA roles and required parent element
- About valid ARIA roles
- About the
role=text
attribute - About toggle fields
- How to name
tooltip
elements - About labeling
treeitem
elements - About valid values for ARIA attributes
- About valid ARIA attributes
- How to fix duplicate ARIA IDs