STR-005 Give images and icons that carry information a text alternative, and hide the ones that only decorate
- Level
- Rule
- Verdict
- Requirement
- Area
- Page structure
- Status
- proposed, version 1.0.1
Rule
Give an image or icon that carries information a text alternative that says what it tells the person in that place, never a file name or a word that only names the kind of picture. Hide one that only decorates from assistive technology, with alt="" on an img or aria-hidden="true" on an icon.
Examples
Live examples built with Justified's components. Try them with the mouse, the keyboard or a screen reader.
Do: The icon that carries the status has a name
Invoices
- Invoice 2026-114
- Invoice 2026-113Paid
Don't: The only sign of the status is hidden
Invoices
- Invoice 2026-114
- Invoice 2026-113Paid
aria-hidden and nothing else says the invoice is overdue. A sighted person sees the problem; a screen reader user never learns of it.Do: Avatars named, or empty, by what is beside them
Customers and team
Lena Okafor
alt. In the row of faces with no names, each picture carries the person's name.Don't: A file name and a kind of picture as alternatives
Invoices and customers
- Invoice 2026-114
Lena Okafor
img whose alt is its file name, and the avatar's is "Avatar" beside a name that is already there. The first says nothing useful; the second adds noise to every row.Why
A screen reader cannot see a picture. It reads the text the picture carries in code, and nothing else. A red icon that marks an invoice as overdue says "overdue" to a sighted person; with no text alternative, a screen reader user never learns it. The opposite fails too. An icon that only repeats the word beside it, read aloud as "image" or as a file path, wastes the person's time on every line of a list and buries what matters.
This is a requirement. WCAG 2.2, 1.1.1 Non-text Content asks that anything shown as other than text comes with text that does the same job, and that pure decoration is built so assistive technology can ignore it (Understanding 1.1.1). The Working Group lists as failures an alternative that is only a file name or a placeholder word (F30), and a decorative image given any alternative other than an empty one (F39). Its technique for hiding an img is an empty alt and no title (H67). Whether an image is decorative is the author's judgement from why it is there. Ask what a screen reader user would miss if the image said nothing. If the answer is nothing, it decorates.
Do
- In the invoice list of the bookkeeping app Fernhill, an overdue invoice shows a red clock icon and no text. The icon carries the status, so the SVG has
role="img"andaria-label="Overdue", or a visually hiddenspanwith "Overdue" sits beside it. Better still, our own choice: show the word Overdue next to the icon and hide the icon. - A
Badgereads Paid with a tick icon before the word. The icon adds nothing to the word, so it hasaria-hidden="true". - The adapter's icons (
adapters/shadcn/src/lib/icons.tsx) setaria-hidden="true". With any other icon library, check what it does before relying on it, and give the icon a name when it alone carries meaning. - A customer's
AvatarImagesits next to their name, Lena Okafor. The name is already there, soalt="". In a row of avatars with no names beside them, eachaltis the person's name. - A bar chart of monthly revenue has a short alternative, such as "Revenue rose each month from January to June", and the figures in a table or a sentence nearby. The figures do not go into
alt. - With
next/image,altis required. Write what the image tells, oralt=""when it decorates; never the component's or the file's name to make the type error go away. - Our own choice: keep an alternative to one or two short sentences, and do not start it with "Image of" or "Picture of". The screen reader already says it is an image.
- Our own choice: do not repeat in
altthe caption or heading right beside the image. When nearby text already says what the image tells,alt=""is right. - Avoid images of text; WCAG 2.2, 1.4.5 Images of Text covers when they are allowed. When one is used, its alternative holds the same words.
- A spinner beside "Saving invoice …" is decorative; the text says what is happening, as STA-005a asks.
- An emoji that carries meaning in a label, such as a warning sign, needs words that say what it means. One that only decorates is hidden in a
spanwitharia-hidden="true".
Don't
- Write
<img src={url} />with noaltat all. Many screen readers then read the file name or the address. - Write
alt={file.name},alt="logo",alt="hero"oralt="screenshot". - Hide the overdue icon with
aria-hidden="true"when nothing else on the row says the invoice is overdue. - Give a decorative divider image
alt="decoration"instead ofalt="". - Give an
AvatarImagealt="Avatar". - Show information as a CSS background image. A background image cannot carry a text alternative.
Exceptions
- Icon buttons. An icon that is itself a button, or the only content of one, is named as ACT-001b says, after what pressing it does.
- Image links. An image or icon that is itself a link, or its only content, is named as TXT-003 says, after where it goes.
- Flags in a language picker. A flag that is the only label of a language needs a text alternative under this rule. The language name beside it, and the
langit carries, are STR-006a. - Loading signs. How a wait is announced is STA-005a and FBK-004. This rule only says the spinner graphic itself is decorative when text says what is happening.
Verdict
Requirement. Only the judges decide; the expert witnesses are shown but do not vote. How verdicts work
| Source | Role | Stance | Page |
|---|---|---|---|
| WCAG 2.2 | Law | Requires | 1.1.1 Non-text Content |
| Material Design | Judge | Supports | Accessibility designing: elements Alt text |
| Apple Human Interface Guidelines | Judge | Supports | VoiceOver |
| Carbon Design System | Judge | Supports | Accessibility: Developers |
| GOV.UK Design System | Expert witness | Supports | Images |
| Nielsen Norman Group | Expert witness | Supports | Alt Text: What to Write, by Emma Cionca, Tanner Kohler |
Each stance links to the page it rests on, read on the date in the source register. This page never repeats what a source says; read the source itself.
History
- Version 1.0.1, : Points to STR-006a for a flag in a language picker.
- Version 1.0.0, : First version.
Last checked against the other rules for conflicts on .
More in Page structure: 7 rules and 1 guideline · All rules
Justified is an independent project. It is not affiliated with, sponsored or endorsed by the organisations whose guidance it cites. Read the full statement.
Apple is a trademark of Apple Inc., registered in the U.S. and other countries and regions.