How to expose the state of a mute icon button
Answer in brief
A mute toggle can keep a stable name and expose its state through aria-pressed. Update the state whenever mute changes, including changes made with keyboard shortcuts.
Follow one complete cycle
Start with a button named “Mute” and aria-pressed="false". Activate it and verify both the audio behavior and the transition to true. Activate again and verify that the original state returns.
Synchronize external mute changes
An external device or a separate player control can change mute without a click on this button. Derive the displayed icon and pressed state from the player's current mute value. Change mute from the second control and inspect the first button before activating it again.
Sources
- [1] Button Pattern | APG | WAI | W3C — W3C, accessed November 23, 2026
Frequently asked questions
Should the button name switch to Unmute?
For a pressed-state toggle, keep the name stable. A command whose name changes to describe the next action uses a different labeling pattern.