Accessibility
a11y/iframe-title
Every visible iframe has a title that says what it contains (map, video, payment form).
seriousstaticWCAG 4.1.2 · Afe-a11y-core
Why
Screen readers announce an iframe by its title. Without one, people hear "frame" and must enter it to find out whether it is a video, a map or an advert, often on every page.
Fix
Add title with a short description of the content: title="Product video: setting up sync", title="Card payment form". Embeds from component libraries usually accept a title prop; pass it. Hide purely technical frames with hidden or aria-hidden="true" and tabindex="-1".
Examples
<!-- bad -->
<iframe src="https://www.youtube-nocookie.com/embed/abc123"></iframe>
<!-- good -->
<iframe src="https://www.youtube-nocookie.com/embed/abc123" title="Video: setting up sync in two minutes"></iframe>Sources
Facts
- Id
a11y/iframe-title- Severity
- serious
- Check
- static checked in the source by
audit - Applies to
htmlangularvuesvelteastrojsx- WCAG 2.2
- 4.1.2, level A
- Same problem in
- axe-core
frame-title, Lighthouseframe-title - Taught by the skill
fe-a11y-coreAccessibility, WCAG 2.2 map- Since version
- 0.1.0
Read it in the terminal
npx github:dawidolko/frontend-skills explain a11y/iframe-title