You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
New rule: a11y/svg-img-alt - SVG images marked role="img" with no accessible name #1699
An inline <svg role="img"> is announced by screen readers as an image. Without a name it is read as "image" or skipped, so a chart, logo or icon that carries meaning is lost. a11y/aria-labels checks SVGs only when they are clickable (onclick or tabindex). Informative SVGs with role="img" are not checked.
Proposal
A page rule, a11y/svg-img-alt, matching the axe-core rule of the same name: every <svg role="img"> needs an accessible name.
Acceptance Criteria
An <svg role="img"> with no <title> child, no aria-label and no aria-labelledby fails, and the finding locates the element.
An <svg role="img"> with a non-empty direct <title> child passes.
An <svg role="img"> with a non-empty aria-label, or an aria-labelledby that resolves to text on the page, passes.
An aria-labelledby that points at an ID missing from the page fails.
An SVG with aria-hidden="true" or role="presentation" is not assessed.
An SVG with no role attribute is not assessed.
An SVG that is hidden from view is not assessed.
The finding counts each failing SVG once, and a clickable SVG already reported by a11y/aria-labels is not reported twice.
The rule has a docs page under docs/rules/a11y/ and appears in the rule catalog and counts.
Shipped in v0.0.176 via 3bc8486 (feat(rules): a11y/svg-img-alt flags svg role=img with no accessible name #1699). Tests, docs page and category index rows are in that release.
Activity
feat(rules): a11y/svg-img-alt flags svg role=img with no accessible n…
nc9 commentedon Nov 11, 2026
Shipped in v0.0.176 via 3bc8486 (
feat(rules): a11y/svg-img-alt flags svg role=img with no accessible name #1699). Tests, docs page and category index rows are in that release.nik