Skip to main content
🎉 A11y Issue Detection Agent is now live! Detect accessibility issues like a WCAG expert with AI. Try now!
No Result Found
Connect & Get help from fellow developers on our Discord community. Ask the CommunityAsk the Community

aria-roles

Rule Severity : Critical

Description

You must use a valid value for the role attribute. If you use a misspelled, non-existent, or abstract ARIA role value, assistive technologies cannot determine the element’s purpose. Screen readers and other assistive technologies may ignore the element or process it incorrectly.

Check the spelling of your roles. Ensure the role corresponds to an existing ARIA role. Also, you must avoid abstract roles (such as roletype, command, or widget). The WAI-ARIA specification intends abstract roles only for internal categorization, not for use in content by developers.

This rule aligns with WCAG Success Criterion 4.1.2 (Name, Role, Value), which requires that the role of every user interface component must be programmatically determinable.

Examples

In the following incorrect example, the role attribute value is input, which is a non-standard value. Assistive technologies will not recognize this role.

Incorrect Sample
Copy icon Copy

In the following corrected example, the role value is valid. Assistive technologies now correctly identify the link as an interactive button.

Correct Sample
Copy icon Copy

How to fix

To fix violations of the aria-roles rule, follow these steps:

  1. Check spelling: Verify that the value assigned to the role attribute is spelled correctly according to the WAI-ARIA specification.

  2. Ensure validity: Confirm the role is an existing, concrete ARIA role (e.g., alert, dialog, navigation).

  3. Avoid abstract roles: Do not use abstract roles like roletype, command, input, or widget.

References

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback!

Talk to an Expert
Download Copy Check Circle