Your daily frequent11y newsletter, brought to you by @ChrisBAshton:
Better accessible names
Hidde de Vries shares some great tips for naming your label
s and aria-label
s:
- Describe what the thing does, rather than what it looks like, e.g. “Next slide” vs “Arrow right”
- Frontload the most unique part of the thing, e.g. in a list of albums, use “Midnight Marauders – Album” over “Album – Midnight Marauders”
- Be concise: 1-3 words is ideal
- Avoid roles, e.g. use “Close” instead of “Close button”, as the role will be announced by screen readers anyway
- Keep names unique, e.g. “See also: [name of page]” vs “Click here”
- Start names with a capital letter, and don’t end with a period – names aren’t sentences. This should lead to better pronunciation by screen readers.
Prefer longer newsletters? You can subscribe to week11y, fortnight11y or even month11y updates! Every newsletter gets the same content; it is your choice to have short, regular emails or longer, less frequent ones. Curated with ♥ by developer @ChrisBAshton.