Skip to main content
Saved

Accessibility as a Foundation

foundation
12 minute read
written by
den odell
added

Accessibility belongs in your architecture from day one, instead of being retrofitted later.

lawsuitsMore than 5,000 digital accessibility lawsuits were filed in the U.S. in 2025.

TL;DR

Accessibility is an architectural decision. It affects how you design components, manage state, handle routing, and test, starting from the first line of code, so you can’t just add it at the end.

  • Accessibility affects every layer of your application, so it’s part of your architecture
  • You start with semantic HTML, using elements that already have a meaning instead of div soup
  • You test with keyboards and screen readers from day one, while you’re still developing
  • Accessible code also tends to be easier to maintain and test

The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.

Tim Berners-Lee

The Afterthought Problem

I’ve watched many development teams treat accessibility the same way they treat security audits or performance optimization, as something to worry about later. They ship the feature first and make it accessible second, or they get to an MVP and plan to circle back for WCAG compliance.

That doesn’t work, because accessibility depends on decisions you make at the very beginning, and if you add it later, you have to go back and change those decisions.

Depending on the decisions you make on day one, it might not be possible to make your app accessible later without rebuilding it.

Some of those decisions, such as which elements your components render and how your router changes pages, are very hard to reverse once the rest of the app is built on top of them.

If you build without thinking about accessibility, you end up with technical debt. It’s usually structural debt, which you can’t refactor away in a sprint, because fixing it means changing how whole parts of the app work. It includes components built without semantic meaning, state updates that screen readers never announce, navigation flows that only work with a mouse, and forms that can’t be completed without sight.

Each component you add without accessible patterns becomes another thing to fix later. The rest of the codebase gets built around those components, so by the time you come to fix them, you end up changing the code that depends on them too.

Architecture, Not Decoration

Accessibility affects every layer of your application, which is why it’s an architectural concern. Anyone who has tried to retrofit accessibility into an application designed without it has found this out.

Accessibility in Every Layer

Component Hierarchy
The way you structure your component hierarchy affects whether focus management works correctly. A modal that's rendered at the end of the document, away from the button that opened it, breaks keyboard navigation unless you explicitly manage focus. A dropdown menu needs ARIA attributes that stay in sync with its JavaScript state.
State Management
The way you manage state affects whether screen reader users find out what's changed. If content updates dynamically, including when a form shows its validation results, your app needs to tell screen readers about it. If an error occurs, focus needs to move to the error so keyboard users can find it.
Routing
If your routing isn't built with accessibility in mind, navigation won't work for everyone. If client-side routing doesn't move focus, keyboard users get lost in the page. And if a URL change isn't announced, screen reader users don't know the page changed.
Data Fetching
The way you fetch data affects whether your loading states are accessible. Someone using a screen reader needs to know when loading finishes and whether it failed. Blind users get no information from a spinner that's purely visual.

To build an accessible application, you decide how its structure gets exposed to assistive technology. You have to spell out what each part of the interface is, as well as how it looks.

That’s why, if you retrofit accessibility, you have to go back over all of those decisions.

The Progressive Enhancement Connection

Progressive enhancement and accessibility are both built on semantic HTML.

With progressive enhancement, you start with HTML that works everywhere, such as forms that submit and links that navigate. That HTML is accessible from the start, because browsers already know how to expose those elements to assistive technology.

Two Sides of the Same Coin

Abandoning Semantic HTML

If you abandon HTML in favor of <div> soup with JavaScript event handlers, you lose both progressive enhancement and accessibility at the same time:

  • Click handlers don’t work without JavaScript
  • There’s no keyboard navigation
  • Screen reader users get no information about what each element is
  • The page only works for people using a mouse in a browser with JavaScript enabled

Building Accessible Applications

Building an accessible application gets you the benefits of progressive enhancement for free:

  • Semantic HTML works without JavaScript
  • With keyboard support, your site works with switch devices and with keyboards attached to tablets and phones
  • With focus management in place, your application works with a range of input methods
  • Live region announcements tell screen reader users about changes they can’t see

In both cases, you build on HTML first and add JavaScript on top.

The Progressive Enhancement Mindset goes into more detail on how the two approaches support each other.

Semantic HTML as Bedrock

An accessible application starts with semantic HTML. You use elements that already have a meaning, instead of adding role attributes to <div> elements.

HTML was designed with that meaning built into its elements, and browsers and assistive technologies rely on it.

You use <button> for actions instead of <div onClick>, and <a> for navigation instead of a <span> with routing. <main>, <nav>, <aside>, <article> and <section> structure your content, <form> collects input, <label> describes fields, and <table> is for tabular data, not layout.

If you choose the right element, anyone reading the markup can tell what each part of the page is for.

These elements also expose the page’s structure to assistive technologies. A screen reader announces “button” when it gets to a <button>, but if you use a <div> with an onclick handler, it announces “clickable” or nothing at all.

Semantic HTML vs ARIA

Choose the Right Element Choosing the right element gets you accessibility for free: Wrong Element + ARIA = Playing Catch-Up Choosing the wrong element and trying to fix it with ARIA:
  • Focus management works
  • Keyboard interaction works
  • Screen reader announcements work
  • You rarely need ARIA attributes, because the element already has the right meaning
  • You need to add role="button" and tabindex="0"
  • You need onKeyDown handlers for Space and Enter keys
  • You need to handle the disabled state yourself, because a div has no disabled attribute
  • You need to manage focus explicitly

The first rule of ARIA is to not use ARIA if semantic HTML can accomplish the same thing. Each ARIA attribute you add is one more thing your team has to keep up to date.

Component Design Starts With Accessibility

As you design components, you have to think about accessibility while you decide on each component’s API and how the components fit together.

A modal dialog is a good example. An accessible modal needs all the pieces listed alongside, working together, and they’re part of what a modal is, so you can’t leave them as optional features for later. Without focus management, a modal is just a div that appears on top of content.

Your component API needs to support these requirements. You have to decide which element gets focus when the modal opens, and where focus returns when it closes, and the API needs a way to set both.

The same applies to every interactive component. A tabs component needs roving tabindex, arrow key navigation, Home and End key support, aria-selected, and aria-controls and aria-labelledby to connect each tab with its panel. A combobox needs aria-expanded, aria-autocomplete, aria-activedescendant, and specific keyboard interactions.

These patterns are very hard to add after you’ve built the component, because they affect state management, keyboard event handling, DOM structure, and component lifecycle. They have to be part of the initial design, or you end up rebuilding the component from scratch.

The ARIA Authoring Practices Guide documents the keyboard interaction and ARIA attributes expected for widgets such as tabs and comboboxes, so you can know what a component needs before you start building it.

State Management and Announcements

Whether users know what’s happening in your application depends on how you set up your state management.

Sighted users see the update as soon as state changes, such as a message appearing or new content loading. Screen reader users only find out about these changes if you announce them.

So your state changes and your announcements need to happen together. If a form submission succeeds or data finishes loading, you need to announce it. If validation fails, you need to announce the errors and move focus to the first invalid field.

These announcements belong in your state management layer, so you don’t have to add them to each component one at a time.

An action that shows a notification should trigger an announcement too. The same goes for data updates that change the content the user is focused on.

Frameworks like React, Vue, and Svelte give you lifecycle hooks and effect systems for coordinating DOM updates with side effects such as announcements, but they leave it to you to decide what gets announced and when. You make that decision when you design your state layer.

You make the announcements through live regions. You use aria-live="polite" for non-urgent updates, aria-live="assertive" for critical information, aria-atomic to choose between announcing the entire region or just the changes, and aria-relevant to specify which types of changes get announced. Live regions only work if your app sends its state changes through them consistently.

If you build this into your architecture, the developers on your team get announcements right without having to think about it. If you add it later, each developer has to remember to add announcements manually, and some of them will forget.

Routing and Focus Management

Client-side routing undoes several things the browser does for accessibility on a normal page load.

With traditional links, the browser handles navigation for you. It requests the page, renders the content, resets the scroll position, and moves focus to the top of the page. Users know navigation happened because the page reloaded.

None of this happens automatically if you intercept clicks and render new content with JavaScript. The URL changes but focus stays on the link the user clicked, and screen readers don’t announce the new content. The scroll position might change or might not, and your users can end up disoriented.

Accessible Routing Requirements

Required Steps

  • Focus moves to the new content after navigation completes
  • Screen readers announce the navigation
  • Page titles update so browser history makes sense
  • Loading states are announced
  • The app handles a new navigation that starts before the previous route has finished loading

Effect on Your Architecture

To meet these requirements, your router needs lifecycle hooks that run after navigation, so there’s one consistent place to move focus and announce route changes.

If you build client-side routing without considering accessibility, your application might only work for sighted mouse users. To retrofit focus management later, you have to revisit every route and every navigation trigger.

If you add those router hooks from day one, you avoid that rework.

Testing From the Start

Accessibility testing belongs in development, from the very first component you build.

Your team’s definition of ‘working’ should include accessibility, so it gets checked as you build each feature instead of on a compliance checklist just before shipping.

As you write a component, you check keyboard navigation first, making sure you can get to and activate each interactive element and can always see where focus is. If you can’t, the component is broken, even if it seems to work with a mouse.

Once you add dynamic content, you can test with a screen reader to find out whether new content and errors get announced. If they don’t, the feature isn’t finished.

Forms need testing with a keyboard, a screen reader, voice control, and switch control. If you can’t recover from errors and submit the form with each of them, the form doesn’t work.

If you test from the start, you catch problems while they’re still quick to fix. Correcting the ARIA attributes on one component might take five minutes, but correcting the same pattern across fifty components can take weeks.

Automated testing helps, but it can’t replace manual testing. Tools like axe-core and Lighthouse detect obvious issues such as missing alt text or insufficient contrast, but they can’t detect when keyboard behavior is wrong or an announcement is unhelpful, so a person has to test those.

Manual accessibility testing works best when it’s part of your normal development workflow. You can use a screen reader, navigate with only the keyboard, try voice control, and check the page under simulated visual impairments in your browser’s developer tools. It can become as routine as testing in different browsers.

The Cost of Ignoring Accessibility

Ignoring accessibility can lead to lawsuits and lost customers, and the number of lawsuits is rising. UsableNet counted 2,314 digital accessibility lawsuits filed in U.S. federal courts in 2018, and more than 5,000 in 2025 across federal and state courts. Even if a lawsuit settles quickly, you still pay legal fees as well as paying to fix the site.

Settlements can be large. Target paid $6 million in damages to settle a class action over its website in 2008. Domino’s Pizza, Netflix, Winn-Dixie, Beyoncé’s website, and hundreds of others faced lawsuits under the Americans with Disabilities Act. Several courts have ruled that websites can count as places of public accommodation subject to accessibility requirements, though not every court has agreed.

If your site isn’t accessible, you also lose customers who want to buy from you, so it’s a business problem as well as an ethical one.

Retrofitting a large application can take several engineers months, and they spend that time fixing existing features instead of building new ones.

A retrofitting project usually involves:

  • Auditing every component and page
  • Redesigning component APIs to support accessibility
  • Rewriting components that can’t be made accessible
  • Updating state management to handle announcements
  • Fixing routing and focus management globally
  • Testing everything again across devices and assistive technologies
  • Training your entire team on accessible patterns

There’s an ethical side too. Banking, shopping, education, government services, and entertainment are increasingly online, so inaccessible software stops disabled people from doing everyday things, regardless of any legal or business consequences.

The Upside of Building It Right

Building accessibility in from the start also has benefits of its own.

The Benefits

Better Code

Semantic HTML is easier to maintain than <div> soup with role attributes. Keyboard navigation helps power users as well as the people who rely on it.

No Retrofitting Project

Each feature is accessible when it ships. There’s no separate cleanup phase before launch, and audits are less likely to find problems built into the architecture.

Easier Testing

If components follow consistent accessible patterns, you know what to test. And if announcements are handled in your state management layer, you don’t need to check the announcement logic in each component separately.

You can still be sued, but if you can show that your team follows accessibility practices, you’re less likely to face a complaint, and you’re in a much better position if one does arrive.

Expanded Market

Accessible sites work for more users, including elderly users with declining vision or motor control and people with temporary disabilities like a broken arm. They also help anyone dealing with a situational limitation, like trying to read a screen in bright sunlight.

Good Engineering

Building sites that everyone can use, regardless of ability, is the right thing to do, and the practices that get you there, such as semantic HTML and consistent component patterns, are good engineering anyway.

Building Accessibility Into Your Culture

To make accessibility part of the foundation, your team has to change how it works, as well as changing its code.

Developers

Developers need ongoing training, because a single workshop is easy to forget, and the way the team works should back that training up:

  • Accessible patterns should be in your component library
  • Code reviews should check accessibility
  • Pull request templates should include accessibility testing steps
  • Accessibility should be a normal part of the definition of done

Designers

Designers need to build accessibility into the main design, instead of producing a separate accessible version:

  • Color contrast should be verified in design tools
  • Focus states should be designed
  • Keyboard interaction should be specified
  • Screen reader announcements should be documented

Product Managers

Product managers need to treat accessibility as core functionality and prioritize it that way, instead of leaving it as technical debt or polish for later:

  • Accessibility work should be estimated in stories
  • Accessibility bugs should be treated like any other bug, because they stop the feature from working correctly
  • Shipping inaccessible features should be as unacceptable as shipping broken features

The Organization

Changing how a whole organization works takes time. While accessibility is one person’s job, it tends to stay an afterthought, and it only becomes part of how you build software once everyone takes responsibility for it.

The Path Forward

Accessibility has to be part of your architecture from day one. It affects how you design components, manage state, handle routing, and test, so adding it at the end takes a lot of rework.

In practice, you start with semantic HTML and the right elements for the job, layer enhancements on top of that structure, test with keyboards and screen readers as you develop, build announcements into state management and focus management into routing, and make accessibility part of what “working” means.

Building this way takes less work than retrofitting, lowers your legal risk, and gives you software that works better for more people.

Summary

  1. Accessibility is part of your architecture, and it affects component design, state management, routing, and testing from day one
  2. If you build with semantic HTML and progressive enhancement, much of the accessibility comes built in
  3. You test with keyboards and screen readers throughout development, as well as before launch
  4. Announcements belong in state management, and focus management belongs in routing
  5. If you ignore accessibility, the legal risk and the work needed to fix it keep growing over time
  6. If you build accessibility in from the start, your code is easier to maintain and you avoid a retrofitting project later

Related Content:

External Resources:

Next Foundation · 14 min read

Component-Driven Architecture

Frontend development has moved from building whole pages to building interfaces out of small, reusable components.

Read the next Foundation →

Keep Exploring

A monthly email
from Den Odell.

What I'm thinking about frontend patterns, plus news when the site changes.

No spam. Unsubscribe anytime.