Interactive widgets & ARIA
When the control you need exists in HTML — a button, a checkbox, a
<select>, a <details> — the browser gives you its
role, its keyboard behaviour, its focus handling, and its states for free, and assistive
technology already knows how to speak it. ARIA exists for the cases that HTML can’t
express: a tab list, a tree, a custom combobox. It’s a vocabulary for telling assistive
technology what a piece of UI is and what state it’s in. But ARIA only changes
how something is announced — it adds no keyboard behaviour and no focus management on its
own. That’s why the first rule of ARIA is the most important one: if a native
HTML element does the job, use it instead of recreating it with ARIA.
Who this affects
- Screen reader users hear a control’s role and state to know what it
is and what it’ll do — “button”, “tab, selected”, “expanded”. A
<div>wearing anonclickis announced as nothing at all; a toggle with noaria-pressednever tells them whether it’s on or off; anaria-labelledbypointing at a missing id leaves the control unnamed. - Keyboard users need to reach and operate every control with Tab,
Enter, Space, and the arrow keys. ARIA adds none of that — a fake button built from a
<div>isn’t focusable or operable until you wire it up by hand, andaria-hiddenon focusable content drops them onto controls they can’t see.
Standards covered
The lessons in this category map custom-widget accessibility to the success criteria and laws that require it. The same fixes satisfy all of them at once.
Lessons
-
Accessible names for interactive controls
Give every button, link, and field a name assistive technology can announce — from visible text to
aria-labelandaria-labelledby, and the order the browser uses to compute it.4.1.2 2.5.3 1.1.1 -
ARIA & custom widgets
Use native HTML first; when you must build a custom widget, give it the right role and keep its state in sync, reference real ids, and never hide focusable content from assistive technology.
4.1.2 1.3.1 Accordions & disclosure widgets
Use real buttons with aria-expanded kept in sync with the panel.
Toggle buttons & switches
Expose pressed or checked state and announce the change to assistive tech.
Native first, ARIA second
These two lessons pair up: Accessible names makes sure each control says what it is, and ARIA & custom widgets makes sure it has the right role and state behind that name. No ARIA at all beats wrong ARIA — reach for a native element before you build a custom one.