Skip to main content
WCAGrules
Quick navigation

ARIA state

aria-pressed

Whether a toggle button is currently pressed. This is what makes a button a toggle.

It is the difference between a button and a toggle. Present, the button announces as pressed or not pressed and people know the state is going to stick. Absent, it is an ordinary button that does something once.

Which roles may carry aria-pressed

Value
tristate
Filed as
A state, which is how ARIA files it and not a rule about how often it changes.
Roles that may carry it
button

Those lists are not advice. Browsers are required to ignore a non-global attribute sitting on a role that does not support it, so aria-pressed on the wrong element is not weak, it is absent. You can read it in the DOM and nobody using a screen reader can.

Every role above comes from the specification's own list for this attribute, checked name for name. The normative definition stays with the W3C, in the aria-pressed section of the ARIA specification.

Keeping aria-pressed true

So it has to move on every press, including the presses your own code makes on somebody's behalf. A toolbar button styled as active with aria-pressed still on false is the shape to watch for, because the styling and the announcement come from different places and usually only one of them is kept up. Taking the attribute off entirely is a real change rather than a cleanup, since it turns the toggle back into a plain button and quietly removes the state people were relying on.

How aria-pressed gets checked

There are test rules that check an ARIA attribute is one that exists, is allowed on the role underneath it, and carries a value of the right type. What they map to is ARIA's own author requirements rather than any WCAG criterion, so a misplaced attribute breaks ARIA without being a WCAG failure by itself. It becomes one under 4.1.2 Name, Role, Value the moment the missing or wrong value means the control's state cannot be worked out programmatically, which is what usually happens next.

Nothing automated catches the failure this page is about. A stale value is a valid value, on a permitted role, with the right type. It is only wrong about the world.

Attributes you will meet alongside aria-pressed

  • aria-disabled Says a control is present but not available. Unlike the disabled attribute, it stays focusable, so people can still find out it is there.
  • aria-expanded Whether the thing this control opens is currently open.
  • aria-haspopup Says this control opens something, and what kind of thing it opens. A menu, a dialog, a listbox.

Every ARIA state and property · Every ARIA role · ARIA explained

Go somewhere useful

Find tools, resources and your workspace.

29 destinations