aria-pressed state is used to inform the user that an element is a toggle button. aria-checked(state) and aria-selected (state) (future link) are similar to aria-pressed.
In normal state aria-pressed will be in release state and the value is false. When the user clicks or activates the button it changes to pressed state where the value is “trueâ€. Aria-pressed state also has the third value “mixedâ€. If the button does not have the property of toggle do not use aria-pressed. The roles in which aria-pressed can be used is button.
Values of aria-pressed (state)
Characteristic | Description |
---|---|
True | Indicates that the button is currently pressed |
False | Indicates that the button has the toggle property and is currently not pressed. |
Mixed | Indicates a mixed mode value for a tri-state toggle button. |
Undefined (default) | The element does not support the pressed state. (Do not use the aria-pressed at all). |
Have a look at the aria-pressed example to understand how it works.