Topic 5 of 6 · 5 min read
How AI-generated interfaces exclude people
Goal: Find the keyboard, labelling, focus and semantic failures in an AI-generated interface and name the fix for each.
Interfaces generated by AI look right but often fail people who use a keyboard or a screen reader, so review them for semantics, labels, focus and motion before they ship. The picture is correct. The structure behind it is often not.
Check yourself · 1 of 3
An AI generates a clickable div that works as a Save button. What is the main problem?
Why it matters
Prompt-to-UI tools and coding assistants such as Cursor, Copilot, v0 and Claude learn from a web full of inaccessible code. They copy common patterns, including bad ones. A page can look polished and still be unusable for someone who never touches a mouse.
What to look for
- Clickable divs. A
divwith a click handler is not a button. It cannot be reached by keyboard and is not announced as a button. Use a realbutton, orafor navigation. - Missing labels. An input with only a placeholder has no reliable name. Placeholders vanish when typing. Use a visible
labeltied to the input. - Icon-only controls. A button showing only an icon needs an accessible name, such as
aria-label="Close". - Lost focus. Check you can see which element has focus. A modal must move focus in, keep it inside while open, and return it on close. Never remove the focus outline without a visible replacement.
- Heading and landmark structure. Headings chosen for size, not order, make navigation by heading useless.
- Motion. Auto-playing animation and parallax can cause discomfort. Respect
prefers-reduced-motion. - Colour-only states. Selected, error and success shown only by hue fail for people who cannot tell the colours apart.
A short code branch
<!-- Before: AI output -->
<div class="btn" onclick="save()">Save</div>
<!-- After -->
<button type="button" onclick="save()">Save</button>
The native button gives keyboard focus, Enter and Space activation and the right role, with no extra code.
What goes wrong
- The model adds ARIA roles to a div instead of using the native element, and forgets the key handlers, so it is announced as a button but still does not work from the keyboard.
- ARIA is added where it is not needed and contradicts the real element.
- The prompt never mentioned accessibility, so nothing is checked.
Put the requirement in the prompt, such as "use semantic HTML and make every control keyboard operable", and then test it yourself by tabbing through the page.
Examples
Icon-only close button
AI output: a span with an X icon and a click handler.
Problems: no keyboard access, no name. Fix: a button with aria-label="Close" containing the icon, and visible focus styling.
Placeholder as label
A signup form shows "Email" only as placeholder text. Once the user types, the label disappears and a screen reader may announce nothing useful.
Fix: add a visible label for="email" linked to the input.
Key points
- Generated interfaces can look correct while failing keyboard and screen-reader users.
- A div with a click handler is not a button; use native elements first.
- Every input needs a real label, and every icon-only control needs an accessible name.
- Focus must stay visible and be managed in dialogs and menus.
- Tabbing through the page with the keyboard is the fastest first test.
Common mistakes
- Accepting generated markup because the screenshot looks right.
- Adding ARIA roles to a div instead of switching to a native element.
- Using placeholders in place of labels.
- Removing the focus outline for looks.
Check yourself · 2 of 3
A generated search field uses only a placeholder that says "Search". What is the best fix?
Check yourself · 3 of 3
What is the quickest manual check for a generated page before deeper testing?
Practice items, not counted towards your mastery.
Start here
- Web Content Accessibility Guidelines (WCAG) 2.2 (opens in a new tab)StandardFree
The standard itself, with every success criterion and the contrast ratios used in this skill.
- An alt Decision Tree (W3C WAI) (opens in a new tab)DocsFree
Step-by-step way to decide whether an image needs alt text, empty alt or a longer description.
- WebAIM Contrast Checker (opens in a new tab)ToolFree
Gives the exact ratio for two colours and AA or AAA results.
More for this topic
- Notes on using ARIA (W3C WAI) (opens in a new tab)StandardFree
The W3C's overview of ARIA, including the rule to prefer native HTML elements where they exist.