iframeTitles
Reports <iframe> elements without a title prop.
✅ This rule is included in the jsxlogicalandlogicalStrictpresets.
The title attribute on <iframe> elements provides a label that describes the iframe’s content to screen reader users.
Without it, users may have difficulty understanding the purpose of the iframe.
This is required for WCAG 2.4.1 and 4.1.2 compliance.
Examples
Section titled “Examples”<any
iframe /><any
iframe src: string
src="https://example.com" /><any
iframe title: string
title="" /><any
iframe title: undefined
title={var undefined
undefined} /><any
iframe title: string
title="This is a unique title" /><any
iframe title: string
title={const uniqueTitle: string
uniqueTitle} />;<any
iframe title: string
title="Video player" src: string
src="video.mp4" />When Not To Use It
Section titled “When Not To Use It”If you’re not using iframes in your application, or your iframes are implicitly handled by a framework, you can disable this rule.
Further Reading
Section titled “Further Reading”Equivalents in Other Linters
Section titled “Equivalents in Other Linters”- ESLint:
jsx-a11y/iframe-has-title - Oxlint:
jsx_a11y/iframe-has-title
Made with ❤️🔥 around the world by
the Flint team and contributors.