svgTitles
Reports <svg> elements without a <title> child element.
✅ This rule is included in the jsxlogicalandlogicalStrictpresets.
SVG elements should include a <title> child element to provide accessible descriptions for screen readers.
Without a title, users who rely on assistive technologies cannot understand the purpose or content of the SVG.
The <title> element provides descriptive text that screen readers can announce.
Alternatively, you can use aria-label or aria-labelledby attributes for accessibility.
This is required for WCAG 1.1.1 compliance.
Examples
Section titled “Examples”<any
svg /><any
svg viewBox: string
viewBox="0 0 100 100" /><any
svg> <any
circle cx: string
cx="50" cy: string
cy="50" r: string
r="40" /></any
svg><any
svg> <any
desc>Description only</any
desc></any
svg><any
svg> <any
title>Accessible title</any
title></any
svg><any
svg> <any
title>Circle</any
title> <any
circle cx: string
cx="50" cy: string
cy="50" r: string
r="40" /></any
svg><any
svg aria-label: string
aria-label="Accessible label" /><any
svg aria-labelledby: string
aria-labelledby="title-id"> <any
circle cx: string
cx="50" cy: string
cy="50" r: string
r="40" /></any
svg>When Not To Use It
Section titled “When Not To Use It”If you’re using a framework that automatically injects appropriate titles for SVG elements, you can disable this rule.
Further Reading
Section titled “Further Reading”Equivalents in Other Linters
Section titled “Equivalents in Other Linters”- Biome:
noSvgWithoutTitle
Made with ❤️🔥 around the world by
the Flint team and contributors.