iframeTitles
Reports <iframe> elements without a title prop.
✅ This rule is included in the jsx logical
preset.
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”<iframe />
<iframe src="https://example.com" />
<iframe title="" />
<iframe title={undefined} />
<iframe title="This is a unique title" />
<iframe title={uniqueTitle} />
<iframe title="Video player" 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 ❤️🔥 in Boston by
Josh Goldberg and contributors.