On this page

Roles, Names & States

The three questions#

Inspect

Ask of every control

Role
What kind of thing is this?
Name
What is it called?
State
What condition is it in?

Quick reads

  1. Role — button, link, heading, checkbox…
  2. Name — computed accessible name string
  3. State — expanded, checked, disabled, selected…

Deep dives live in Accessible Names and States & Properties.

Names#

Interactive demo

Name computation playground

Name source

Live preview

Name source
text content
Role
button
Name
"Save draft"
State
enabled
Markup
<button type="button">Save draft</button>

States#

Interactive demo

State playground

ARIA state

Role
button
Name
"Details"
State
aria-expanded="false"