Skip to content

svgTitles

Reports <svg> elements without a <title> child element.

✅ This rule is included in the jsx logical and logicalStrict presets.

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.

<
JSX.IntrinsicElements.svg: SVGProps<SVGSVGElement>
svg
/>
<
JSX.IntrinsicElements.svg: SVGProps<SVGSVGElement>
svg
SVGAttributes<SVGSVGElement>.viewBox?: string | undefined
viewBox
="0 0 100 100" />
<
JSX.IntrinsicElements.svg: SVGProps<SVGSVGElement>
svg
>
<
JSX.IntrinsicElements.circle: SVGProps<SVGCircleElement>
circle
SVGAttributes<SVGCircleElement>.cx?: string | number | undefined
cx
="50"
SVGAttributes<SVGCircleElement>.cy?: string | number | undefined
cy
="50"
SVGAttributes<SVGCircleElement>.r?: string | number | undefined
r
="40" />
</
JSX.IntrinsicElements.svg: SVGProps<SVGSVGElement>
svg
>
<
JSX.IntrinsicElements.svg: SVGProps<SVGSVGElement>
svg
>
<
JSX.IntrinsicElements.desc: SVGProps<SVGDescElement>
desc
>Description only</
JSX.IntrinsicElements.desc: SVGProps<SVGDescElement>
desc
>
</
JSX.IntrinsicElements.svg: SVGProps<SVGSVGElement>
svg
>

If you’re using a framework that automatically injects appropriate titles for SVG elements, you can disable this rule.

Made with ❤️‍🔥 around the world by the Flint team and contributors.