Back to HTML

When You Need ARIA and When You Do Not

Coding Tutorials Team 18 June 2026

ARIA is a set of roles, states and properties that describe the meaning of an interface to assistive technology. It exists to cover cases HTML cannot express, and it is applied far more often than it is needed.

The first rule

The specification opens with a rule stating that if a native HTML element provides the semantics and behaviour you require, use it rather than repurposing something else and adding ARIA.

The reason is that ARIA changes only what is reported. Adding a button role to a div makes it announce as a button and does not make it focusable, does not make it respond to the keyboard, and does not make it activate. You have promised behaviour the element does not have, which is worse than saying nothing.

A real button gives you all of it and needs no attributes at all.

Bad ARIA is worse than none

An element with no role is announced generically, and the user learns nothing but is not misled. An element with the wrong role actively misinforms them, and they will interact with it based on what they were told.

Common examples include a role that contradicts the element, a state attribute that is never updated so it permanently reports the wrong thing, and a label that replaces perfectly good visible text with something less useful.

Where it is genuinely needed

Several patterns have no native equivalent. Tab interfaces, comboboxes, tree views, sliders with two handles, and live regions announcing dynamic updates all require ARIA, because HTML provides nothing that does the job.

These are also the patterns with the most demanding keyboard requirements, and building one correctly means implementing the full pattern rather than adding a role and hoping. The published authoring practices document each one in detail, and following them closely is the only reliable route.

The attributes worth learning first

A small set covers most everyday needs.

An aria-label supplies an accessible name where no visible text exists, which is the common case for icon-only buttons. An aria-labelledby does the same by pointing at existing text, which is preferable when that text is on the page, because it stays in step and matches what a voice control user can say.

An aria-describedby attaches supplementary text, announced after the name. Form hints and error messages are its main use.

An aria-expanded reports whether a disclosure control is open, and must be updated whenever the state changes. An aria-current marks the current item in a set, most often the current page in navigation.

An aria-hidden removes an element from the accessibility tree entirely, which is right for decorative icons and duplicated text, and dangerous anywhere near focusable content.

The aria-hidden trap

Never place aria-hidden on an element containing anything focusable. The element disappears from the accessibility tree while remaining in the tab order, so a keyboard user can focus something that, as far as their screen reader is concerned, does not exist.

Where content should be unavailable entirely, hide it properly with display none or the inert attribute, which removes it from both the tree and the tab order.

Live regions

Content that changes without a page load is not announced unless it sits in a live region. A polite region announces at the next natural pause, and an assertive one interrupts immediately.

Two practical points. The container must exist in the page before the content is inserted, since software watching for changes needs something to watch. And assertive should be reserved for genuinely urgent messages, because interrupting someone mid sentence for a routine confirmation is disruptive.

Labels must match visible text

Where a control has visible text, any accessible name you supply should contain that text. Voice control users say what they see, and a mismatch means the command finds nothing.

This is a common failure with aria-label used to make a name more descriptive. Extending the visible text with additional hidden text achieves the same clarity without breaking the match.

Test rather than assume

Automated checkers catch missing names and contradictory roles and cannot tell you whether an interface makes sense. The accessibility panel in browser tools shows the computed tree, which reveals what your markup actually produced.

Beyond that, using a screen reader yourself for ten minutes is more informative than any amount of reading. It is uncomfortable at first and it is the fastest way to understand why the first rule exists.