Sheath rule
a11y-required-aria-properties
- Package
- Core
- Category
- Accessibility
- Default severity
- error by default
- Auto-fix
- Manual fix
#Why
Some roles cannot communicate their state without specific properties. For
example, checkbox requires aria-checked, slider requires aria-valuenow,
and combobox requires aria-controls and aria-expanded. A focusable
separator also requires aria-valuenow; a non-focusable separator does not.
#Examples
#Bad
<div role="checkbox">Receive updates</div>
<div role="slider" aria-valuenow=""></div>
#Good
<div role="checkbox" aria-checked="false">Receive updates</div>
<div role="slider" :aria-valuenow="value"></div>
<input type="checkbox" name="updates">
Native HTML semantics satisfy equivalent requirements, so native checkboxes, headings, selects, options, meters, and range inputs are not asked to duplicate their state with ARIA.
#Scope
Each explicit conditional path is checked independently. Opaque attribute providers and conditional or dynamic accessibility-tree exposure are not checked because the final required properties cannot be known.
Roles outside the accessibility tree (hidden, inert, or
aria-hidden="true", including on an ancestor) are outside the requirement.
Native disabled controls, including controls disabled by a fieldset, are not
treated as focusable separators merely because they have a tabindex.
Coverage follows WAI-ARIA 1.2 role and property definitions. ARIA 1.3 and extension-module roles are outside its scope, including when an extension role appears before a core fallback token.