Errors must explain: what's wrong, why, and how to fix.
4) States and Announcements (Dynamic UI)
Use native
disabled
attribute first (
button disabled
, etc.).
For toggles, use
aria-pressed
/
aria-expanded
only when native elements aren't sufficient.
Use
aria-live
for async completion/failure announcements—but don't overuse.
5) Keyboard Operation and Focus
Design DOM order so tab sequence is logical. Don't force reorder with
tabindex
.
tabindex="0"
minimal use to make something focusable.
tabindex="-1"
only for programmatic focus movement.
Always preserve visible focus (
focus-visible
). Never hide it.
Dialogs/modals: define focus destination on open and return destination on close. Implement focus trap if needed.
6) Images and Media
Use
alt
based on purpose (decorative images get empty
alt=""
).
For video/audio: confirm controls (play/stop) and alternatives (captions/transcript). Ask if unclear.
Anti-Patterns (Never Do This)
div
with
onClick
acting as button (breaks keyboard/role).
Using
role="button"
as a workaround (use native
button
).
Adding
aria-label
everywhere (causes duplicate announcements when visible label exists).
Removing focus ring (invisible focus = inoperable).
Clarification Questions (Don't Assume)
Must this UI be completable with keyboard only? (If yes, enumerate operation steps and agree.)
For modal/drawer: what gets focus on open? What gets focus on close?
When are errors announced? Immediately? After submit?
Does video/audio need captions or text alternatives?
Output Format (For Implementation)
Semantic structure (landmarks, headings, lists)
Keyboard operation (Tab order, Enter, Space, Escape)
ARIA usage (only where needed, with justification)
States (disabled/loading/error) and announcements (aria-live if needed)
Accessibility checklist self-assessment (OK / needs work)