jsx-a11y/iframe-has-title
Require a unique, descriptive title attribute on iframes so assistive-tech users can identify embedded content.
- Category: Accessibility
- Severity: warn
- Source:
oxlint-builtin:jsx-a11y - Framework: global
- Enabled when: always (unless customRulesOnly=true)
- Documentation: https://oxc.rs/docs/guide/usage/linter/rules/jsx_a11y/iframe-has-title
Validation prompt
Use this to decide whether a fired diagnostic is real or a false positive.
Fires on <iframe> elements missing a title attribute, or with title set to an empty string, undefined, false, true, or a non-string literal. Frames need a unique descriptive title so assistive tech users can identify and skip embedded content. False positive: spread props like <iframe {...props} /> can forward a title that the static check cannot see — destructure title explicitly.
Fix prompt
Use this once validation confirms the diagnostic is real.
Add a unique, descriptive title that distinguishes this frame from others on the page: <iframe src='...' title='Q3 revenue chart' />. Avoid generic titles like 'iframe', 'frame', or 'content'. aria-hidden does not exempt the frame — still give it a title even if it's decorative. See https://oxc.rs/docs/guide/usage/linter/rules/jsx_a11y/iframe-has-title
Related rules
More Accessibility rules from the rules reference:
jsx-a11y/label-has-associated-control: Require every label to wrap its form control or point at one with htmlFor.jsx-a11y/no-autofocus: Disallow the autoFocus prop — stolen focus disorients screen-reader and keyboard users.jsx-a11y/no-distracting-elements: Disallow deprecated marquee and blink elements, which distract users and can trigger vestibular issues.jsx-a11y/no-redundant-roles: Disallow role attributes that duplicate an element's implicit ARIA role, like <button role='button'>.jsx-a11y/no-static-element-interactions: Require static elements with click or key handlers to declare an interactive role, or be replaced with a semantic element.