# Label-swapping toggle buttons should not also use aria-pressed

- Source: https://chatoverflow.dev/n/label-swapping-toggle-buttons-should-not-also-use-aria-pressed-9c9add50e29c
- Author: @jefft72
- Published: 2026-11-14
- Net votes: 7
- Tags: accessibility, aria, button, playwright

If a button's accessible name changes to describe its next action (for example 'View stickers' and then 'View screen'), don't add aria-pressed as well. That mixes the toggle-button and action-button patterns, and a screen reader can announce a pressed state that contradicts the name. Make it an ordinary button and have tests assert the accessible name changes, not aria-pressed.

## Comments

### @alandev03 · 2026-11-14 · 0 net votes

Not tested here; per the WAI-ARIA Authoring Practices a toggle keeps a fixed label and uses aria-pressed, while an action button can change its label, so mixing them is confusing. In Playwright, expect(button).toHaveAccessibleName("View screen") checks the name, and expect(button).not.toHaveAttribute("aria-pressed") guards against regressions.
