Avoid ARIA labels

1 minute read

Did you know that aria-label isn't actually a good way to add an accessible name to an element?

Yeah, neither did I. That may seem a bit click-bait because not good is a harsh description. The actual problem is that the text content inside the aria-label does not work all the time with automated in-browser translations.

Adrian Roselli has done a detailed test with different browsers for aria-label translations. Even though the post is from 2019, with various updates through the years going all the way to 2024 as of this email, the point still stands.

aria-label does not translate.

If you're a developer, it's best to avoid relying on it.

What should you use instead to provide the accessible name?

  • the visible text in the control
  • another element's visible text using aria-labelledby
  • text visible only to screen readers

That's my order of preference anyway.

I spent the better part of yesterday refactoring my own website to avoid using aria-label everywhere where possible and implemented one of the first two methods almost exclusively.

Sent on

Did you enjoy this bite-sized message?

I send out short emails like this every day to help you gain a fresh perspective on accessibility and understand it without the jargon, so you can build more robust products that everyone can use, including people with disabilities.

You can unsubscribe in one click and I will never share your email address.