How Frontend Developers Build Accessible, Honest UIs

For Frontend developers responsible for accessibility · Based on SECourses Build Software People Can Trust

// TL;DR

Frontend developers use this methodology to build UIs that work for everyone and never mislead. The central discipline is distinguishing appearance from authoritative state: a green confirmation screen is not proof the system worked. You treat accessibility users — keyboard-only and screen-reader — as first-class stakeholders whose ability to finish the core task defines success. The keyboard test finds painted boxes: put the mouse away, Tab through the whole task, and if the focus ring skips a control or leaves the page, you've found a styled div pretending to be a button. WCAG 2.2 is your reference standard throughout.

Why isn't a green confirmation screen proof the system worked?

Because a screen showing success is appearance, not authoritative state. When your UI displays 'Order Confirmed' or a green tick, ask which stored, authoritative record supports that message. If a notification failed to send or the booking never persisted, the screen can still show success while the real state tells a different story. As a frontend developer, your job includes making the UI honest: the message should reflect the authoritative state, and when a dependency like notification delivery fails, the screen should say 'delayed' while the booking stays confirmed.

This matters because the people who see your confirmation screen act on it. A misleading success message imposes a cost on them — a double booking, a lost order, a broken trust. Your shortcut becomes someone else's cost.

How do I test accessibility in a real task flow?

Put the mouse away and Tab through the entire core task once. This single keyboard test reveals most accessibility failures. If the focus ring skips a control, gets trapped, or leaves the page unexpectedly, you've found a painted box — a UI element that looks like a control but isn't implemented as one, like a styled div standing in for a real button.

Accessibility means the ability to complete the core task however you use the service: with a mouse, keyboard only, or a screen reader. The reference standard is WCAG 2.2. The fix for a painted box is always the same: replace it with a real, semantically correct element — an actual button or input — so it's reachable by keyboard and announced correctly by screen readers. A painted box isn't a cosmetic issue; it's a stakeholder being unable to finish the task, which means the system doesn't work.

Why are accessibility users stakeholders, not an afterthought?

Because the definition of success must include every stakeholder and every condition of use. If a keyboard-only or screen-reader user cannot finish the booking, the system does not work for them — full stop. That's not a lower-priority bug; it's a failure against the definition of success. Each accessibility concern becomes a system requirement, so you treat it with the same weight as any functional requirement.

The engineers who choose to ship a painted box own the consequence it imposes: a user locked out of the task. Professional responsibility includes consequences on others, and the people affected by that choice didn't make it.

How do I choose the right representation for a UI question?

State the question before you draw anything. For 'what states can this form be in?' use a state diagram — empty, validating, error, submitted, confirmed. For 'what happened first after the user clicked submit?' use a sequence diagram. For 'which cases did we check?' use a test table that includes keyboard and screen-reader paths. Don't default to a flowchart for everything; a flowchart shows steps in order and can't answer which parts rely on which.

And remember: whether you or an AI assistant wrote the component, the keyboard test and the accessibility requirements remain — they describe the system's behavior, not who typed the code.

Next step: Pick your most important user flow, put the mouse away, and Tab through it end to end today. Every place the focus ring skips or escapes is a painted box to replace with a real control before your next release.

// FREQUENTLY ASKED QUESTIONS

What is the fastest way to find accessibility bugs in a UI?

Put the mouse away and Tab through the entire core task once. If the focus ring skips a control, gets trapped, or leaves the page unexpectedly, you've found a painted box — a styled element pretending to be a control. This keyboard test, measured against WCAG 2.2, catches the majority of real accessibility failures faster than any automated scan alone.

What is a painted box and how do I fix it?

A painted box is a UI element that looks like a control but isn't implemented as one — typically a styled div instead of a real button — making it unreachable by keyboard or screen reader. Fix it by replacing it with a real, semantically correct element like an actual button or input, so it's keyboard-focusable and announced correctly by assistive technology.

Should my UI ever show success before the backend confirms it?

No. A success message is appearance; it must reflect the stored, authoritative state. If a dependency like notification delivery fails, show 'delayed' while the underlying booking stays confirmed, rather than a misleading green tick. Users act on your confirmation screen, so an honest message that matches the authoritative state protects them from double bookings and lost orders.