Skip to content

require-svg-accessible-name

Require a name or explicit decorative semantics on inline SVG elements.

Why

Meaningful graphics need a name; decorative graphics should not add unnamed content to the accessibility tree.

Fix

Add aria-label, aria-labelledby, or a direct title child; mark decorative graphics aria-hidden or presentational.

Examples

Before — flagged Name meaningful graphics
src/chart.tsx
<svg>
<path />
</svg>;
After — preferred Identify decorative graphics
src/chart.tsx
<svg aria-hidden="true">
<path />
</svg>;