Documentation/Valid ARIA values

Valid ARIA values

ZMD021

ZemDomu reports static ARIA values that do not match the allowed boolean, token, integer, number, or identifier-list format for the supported attribute.

What this rule catches

  • Invalid static boolean and token values, such as aria-pressed="maybe".
  • Invalid static numeric values, such as a non-integer aria-level value.

What static analysis cannot prove

  • The rule validates value syntax; it does not prove that an ARIA attribute is permitted for the element or role, reflects the current UI state, or improves the experience.
  • Values computed at runtime may need rendered-DOM inspection because their final value is not always available to static analysis.

Standards classification and detection confidence

Classification
normativeThe rule checks static ARIA values against the permitted syntax for supported attributes.
Detection confidence
highSupported static token, boolean, and numeric values are deterministic. Dynamic expressions and whether an attribute is allowed for a role need separate validation.

Applicable WCAG 2.2 criteria

Criterion 4.1.2 applies when states, properties, names, and values must be programmatically available and updated.

Normative means the rule checks a machine-testable part of a cited standards requirement. Advisory means it enforces a documented authoring convention or supporting technique. Neither classification makes a ZemDomu result proof of WCAG conformance.

Examples

✅ Good

<button aria-pressed="false">Mute</button>
<div role="heading" aria-level="2">Title</div>

❌ Bad

<button aria-pressed="maybe">Mute</button>
<div role="heading" aria-level="high">Title</div>

React and Vue notes

React/TSX
ARIA attributes remain hyphenated in JSX and TSX. Test expression-derived values after rendering when the source does not expose a fixed value.
Vue
ARIA attributes remain hyphenated in Vue templates. Test values from v-bind after rendering when their allowed value cannot be resolved statically.

Quick summary

When: A supported ARIA attribute has a static value outside its allowed set

Warning: ARIA attribute "..." has invalid value "..."

Solution: Replace the value with a valid token/boolean/numeric value for that attribute.

Why it matters

Accessibility: Invalid ARIA values can be ignored or interpreted inconsistently, leaving assistive technology with missing or incorrect state information.

Tips & edge cases

  • Prefer native semantics first and use ARIA only when needed.
  • Keep ARIA values literal and standards-compliant when they are static.