[role]s have all required [aria-*] attributes

Accessibility roles include all required attributes so screen readers can describe the element.

On this page

Impact

ScanGov impact ratings

About

Some ARIA roles have required attributes that describe the state of the element to screen readers.

Risks

Screen readers cannot describe the state of interactive elements.

Why it's important

Ensures assistive technologies like screen readers can correctly interpret and announce page elements to users with disabilities.

User stories

As a screen reader user, I want ARIA attributes to be correctly implemented so that I can understand the purpose and state of interactive elements.

Code

Failing pattern:

<!-- Fail: combobox missing required aria-expanded -->
<input role="combobox">

Passing pattern:

<!-- Pass: all required attributes present -->
<input role="combobox"
       aria-expanded="false"
       aria-controls="suggestions"
       aria-autocomplete="list">

Error

ScanGov messaging when a site fails a standard:

Failed: [role]s have all required [aria-*] attributes

Guidance

Indicators

On this page