Accessibility Review of a UI Component
Review the markup and behaviour of one UI component against common accessibility requirements and list concrete fixes.
When to use it
Use it on a single component such as a modal, form, menu or table before it is merged. It checks semantics, keyboard operation, focus management, labels, and colour and motion concerns, and tells you what it could not judge from code alone.
When not to use it: It is not an accessibility audit and cannot certify conformance with any standard. Do not use it in place of testing with a keyboard, a screen reader and a user who relies on assistive technology.
Required inputs
| Placeholder | What to provide | Example |
|---|---|---|
| {{component_code}} | The component's markup and the code that controls its behaviour, including relevant styles if they affect focus or visibility. | A React confirm-delete dialog built from div elements, with onClick handlers and an overlay. |
| {{component_purpose}} | What the component is for and how users operate it. | Asks the receptionist to confirm cancelling an appointment. Opens from a Cancel button. |
| {{target_standard}} | The accessibility standard or guidance your project follows, or 'none specified'. | WCAG 2.2 level AA is our target. |
The prompt
Fill in each {{placeholder}} before you send it.
You are an accessibility-minded front-end engineer reviewing one component. You are working from code only, so you cannot judge anything that depends on rendering or on how it sounds in a screen reader.
<component_code>
{{component_code}}
</component_code>
<component_purpose>
{{component_purpose}}
</component_purpose>
<target_standard>
{{target_standard}}
</target_standard>
Check these areas:
1. Semantics: native elements used where they exist, correct roles only where they do not, headings and landmarks.
2. Names and labels: every control has an accessible name; form fields are labelled; error messages are associated with their fields.
3. Keyboard: everything operable by keyboard, a logical tab order, visible focus, no keyboard traps, expected keys (Escape, arrow keys) where the pattern calls for them.
4. Focus management: where focus goes when the component opens, closes or changes content.
5. Announcements: status changes and errors communicated to assistive technology.
6. Visual and motion: colour not the only signal, text resizing, reduced-motion preferences. Only comment where the code gives evidence.
Rules:
- Quote the code you are commenting on.
- Distinguish "Defect" (the code is wrong), "Risk" (depends on something not shown) and "Cannot judge from code" (needs a real test).
- Do not claim the component conforms or fails to conform to a standard. Say which requirement area a finding relates to and leave the conformance decision to a human tester.
- Do not invent ARIA attributes or behaviour. If you are unsure whether an attribute is valid or supported, say so and point to the relevant specification to check.
- Give a minimal corrected snippet for each Defect.
Output format:
Defects (table: ID | Quote | Problem | Who is affected | Fix)
Risks
Cannot judge from code (and how to test each)
Manual test script (five or six steps using only a keyboard, then a screen reader)Expected output
A table of defects tied to quoted code, each naming who is affected and giving a small fix. For the dialog example, typical defects are a div with onClick instead of a button, no focus move on open, no Escape handling and no dialog role or name. A separate list covers what cannot be judged from code, followed by a short manual test script.
Defects
A1 | <div onClick={cancel}>Cancel</div> | A div is not focusable or announced as a button. | Keyboard and screen reader users | Use <button type="button" onClick={cancel}>.
A2 | no focus call in the open effect | Focus stays on the page behind the dialog. | Keyboard and screen reader users | Move focus to the dialog heading or first control when it opens, and return it to the trigger on close.
Cannot judge from code
- Whether the focus ring is visible against the overlay: check in the browser.
Manual test script
1. Tab to the Cancel button and press Enter. Confirm focus lands inside the dialog.Limitations
- Static review misses most real accessibility problems, which appear only when the component is rendered and used with assistive technology.
- The assistant may recommend ARIA attributes that are unnecessary or wrong. Native elements are usually better, and incorrect ARIA can make things worse.
- Colour contrast and layout cannot be judged from markup alone.
- Guidance and support differ between browsers and screen readers, so findings need checking in the combinations your users have.
How to validate the output
Do these before relying on anything the model returns.
- Written by
- PromptFable Editorial
- Last updated 13 Nov 2026
- Review
- Not yet reviewed
PromptFable is independent and is not affiliated with, endorsed by or sponsored by Anthropic, Google, OpenAI or any other vendor. Claude, Gemini, Google AI Studio and other product names are trademarks of their respective owners.