ARIA (Accessible Rich Internet Applications)

Design Systems & Engineering • UX & Product Architecture

WAI-ARIA is a W3C specification for exposing the roles, states, and properties of interface elements to assistive technology. It can describe information that native HTML alone does not express, such as whether a custom disclosure is expanded.

What do ARIA roles, states, and properties do?

A role identifies what an element is, such as a dialog. A state describes a condition that can change, such as aria-expanded. A property describes an aspect or relationship, such as aria-labelledby, which points to the text that names an element.

Use native HTML when it provides the semantics and behavior you need. Adding role="button" to a

exposes a role. Keyboard focus and activation still need to be implemented.

Example: A fare-rules disclosure

A native button labeled “Fare rules” reveals a hidden panel. While the panel is closed, the button has aria-expanded="false". Activating it shows the panel and sets aria-expanded="true". Closing it hides the panel and restores the false state. A native button gives you Enter and Space activation. Your code keeps the visible panel and reported state in sync. You can optionally use aria-controls to reference the panel’s ID.

How do you test the result?

Verify that the button has the right name and state in the accessibility tree. Test it with a keyboard and a screen reader, and confirm that opening and closing the panel updates both the visible content and the exposed state. A Playwright ARIA snapshot can help catch changes in that exposed structure.

An AI browser agent that reads the accessibility tree can use the same role, name, and expanded state to find the button and decide whether to open it. Run the task with the intended agent to check whether it can open the panel and locate a specific rule. Keep that result separate from accessibility testing for people.

Sources