Why I think accessibility belongs in the component library

A roadside sign reading Drive on Left in Australia above a sweeping surf beach on the Great Ocean Road

Most accessibility programs I have seen are built around the audit. A scanner or a specialist finds the problems, tickets are filed, the team fixes the page, and next quarter the scanner finds the same problems on the pages shipped since.

I think the audit is the wrong unit of work, because the page is the wrong unit of work.

The same five problems

Every large accessibility survey finds the same list at the top, text without enough contrast, images without alternative text, form inputs without labels, links with no text, buttons with no name. Those five account for most of what automated checks detect.

None of them is a page-level decision. Each is a property of a component, made or missed when the component is used. A page does not forget to label an input. A form component allows an input to exist without a label, and a few hundred pages use it that way.

The library is where the problem cannot be made

So I think accessibility belongs in the component library, and I mean something specific by that. The button component does not render without an accessible name. The input component requires a label as part of its contract. The color system exposes pairs that already pass contrast. The icon component demands either a label or a declaration that it is decorative.

When the library works this way, the common failures cannot be produced by an application developer in a hurry, only by changing the library. The audit still runs, but it finds the uncommon problems.

What this asks of the library team

It asks the library's team to own accessibility expertise, rather than spread thin across every product team. A handful of people who know the guidelines deeply, building components that encode what they know, reach every page in the organization. A hundred product engineers each trying to remember the rules reach the pages they work on that week.

It also asks the library to be strict in ways that will annoy its users. A component that refuses to render without a label will generate complaints the first month. I think the complaints are the system working. Each one is a label that would otherwise have been missing.

What it does not cover

The library cannot make a page's reading order sensible, decide what a link should say, or structure a document with headings that mean something. Those are content and layout decisions, and belong to the people building the page. The library takes the mechanical failures off the table so the page's authors can spend their attention on the judgment calls.

That division also makes the audit smaller and more likely to be acted on. A report with eight hundred missing labels gets filed. A report with twelve genuine reading order problems gets fixed.

Photo source: https://photos.robertstowe.com/victoria