Skip to content
BENIBIX Learn

ARIA Attributes

Design♿ AccessibilitySemantic Structure

Also known as ARIA, Accessible Rich Internet Applications (ARIA), WAI-ARIA, ARIA Roles

Extra labels in the code. They tell screen readers what a part is and does.

Think of it like

It is like sticky notes on a box that say what is inside. The box is unchanged.

Example

A home-made menu button gets one ARIA label. Now a screen reader says Menu, shut. After a press, it says open.

Why it matters

Custom widgets are silent to screen readers without it. With it, they can be described.

Definition

ARIA is a set of extra HTML labels that tell helper tools what a part is and what state it is in. It adds roles, like dialog or tab, and states, like open or checked. It only changes what a screen reader says, not how a part looks or acts. The first rule of ARIA is to use a real HTML element when one exists. Wrong ARIA is worse than none.

Example code

html
<button aria-expanded="false" aria-controls="menu">Menu</button>
<ul id="menu" hidden>...</ul>
aria-expanded tells a screen reader whether the menu is open. The script flips it on each press.

Common mistake

Giving a plain box the role of a button instead of using a real one. The role does not make the keys work.

Key takeaways

  1. 1
    Adds meaning only. Not looks or behaviour.
  2. 2
    Real HTML first. The first rule of ARIA.
  3. 3
    Wrong is worse than none. Test with a screen reader.

Compare

Learn it properly