Meaningful SVGs must have an accessible name
Rule
svg-img-name· Images & non-text content · impact serious · Static + live
Why it matters
An SVG that conveys information (especially one with role="img") must expose a name. A nested
How to fix
Add role="img" plus a
Example
<svg role="img" viewBox="0 0 10 10"><path d="M0 0h10v10H0z"/></svg>
<svg role="img" viewBox="0 0 10 10"><title>Company logo</title><path d="M0 0h10v10H0z"/></svg>
Example
<svg viewBox="0 0 10 10"><path d="M0 0h10v10H0z"/></svg>
<svg viewBox="0 0 10 10"><title>Company logo</title><path d="M0 0h10v10H0z"/></svg>
A
Example
<svg viewBox="0 0 24 24"><path d="M12 2L22 20H2z"/></svg>
<svg aria-hidden="true" focusable="false" viewBox="0 0 24 24"><path d="M12 2L22 20H2z"/></svg>
Example
<button><svg viewBox="0 0 10 10"><path d="M0 0h10v10H0z"/></svg></button>
<button>Save <svg viewBox="0 0 10 10"><path d="M0 0h10v10H0z"/></svg></button>
An unnamed decorative SVG inside a control already named by its text is not flagged; icon-only controls still are (the host has no name).
WCAG success criteria
1.1.1 Non-text Content — Level A
All non-text content (images, icons, controls) needs a text alternative that conveys the same purpose, or be marked decorative so assistive tech can ignore it.
Standards
This rule contributes to the following standards:
WCAG A EN 301 549 Section 508 Trusted Tester ACT
| Standard | Criteria |
|---|---|
| Section 508 | 1194.22(a) |
| EN 301 549 | 9.1.1.1 |
| Trusted Tester v5 | 7.a |
| ACT (WCAG SC) | 1.1.1 |