Skip to main content
Version: v6

A Switch ARIA Role is missing required aria attributes

A Switch ARIA Role is missing required aria attributes — rule summary
FieldValue
Rule codeSwitch_AttributeRequirement_Missing
WCAG conformance levelA
WCAG success criterion4.1.2 Name, Role, Value
Must be fixed at sourceNo

Description

The Switch ARIA role requires the 'aria-checked' attribute to communicate its state (on/off) to assistive technologies. Without this attribute, users relying on screen readers or other assistive tools won't be able to determine the switch's state, causing accessibility issues. The aria-checked attribute must be set to 'true' for the 'on' state or 'false' for the 'off' state. More details: https://www.w3.org/TR/wai-aria-1.1/#switch.

How to fix

Ensure each element with role='switch' includes the 'aria-checked' attribute to indicate its state (e.g., <div role='switch' aria-checked='true'></div> or <div role='switch' aria-checked='false'></div>).