Building Accessible Web Apps: A Developer Guide

Esther Howard's avatar

João Castro

blog-details-cover

Introduction

Approximately 15% of the world's population lives with some form of disability. When web applications are not accessible, they exclude hundreds of millions of potential users. Beyond the ethical argument, accessibility is increasingly a legal requirement -- the European Accessibility Act takes full effect in June 2025, and ADA lawsuits related to web accessibility continue to increase in the United States.

The good news is that the most impactful accessibility improvements are straightforward to implement. This guide focuses on practical, high-impact changes that make web applications usable by everyone.

Semantic HTML Is the Foundation

The single most impactful thing you can do for accessibility is use semantic HTML elements correctly. Screen readers, which are used by blind and low-vision users, rely on HTML semantics to understand page structure. A <nav> element tells the screen reader "this is navigation." A <button> tells it "this is an interactive control." A <div> with a click handler tells it nothing.

Use <header>, <main>, <footer>, <nav>, and <aside> to define page regions. Use heading tags (<h1> through <h6>) in logical order to create a document outline. Use <button> for interactive controls and <a> for navigation links. These choices cost nothing in terms of visual design but make the application navigable for screen reader users.

Keyboard Navigation

Every interactive element in your application must be operable with a keyboard. Many users cannot use a mouse due to motor disabilities, and keyboard navigation is also essential for screen reader users. This means all buttons, links, form controls, dropdowns, modals, and custom widgets need to be focusable and activatable with keyboard keys.

Test your application by navigating entirely with the Tab key, Enter key, and Arrow keys. If you encounter an interactive element you cannot reach or activate with the keyboard, it is an accessibility barrier. Common issues include custom dropdowns that only respond to mouse clicks, modals that do not trap focus, and decorative elements that receive unnecessary focus.

Color and Contrast

Sufficient color contrast between text and background is essential for users with low vision, color blindness, or who are reading in bright sunlight. The Web Content Accessibility Guidelines (WCAG) require a contrast ratio of at least 4.5:1 for normal text and 3:1 for large text (18px bold or 24px regular).

Equally important: do not convey information through color alone. If error states are indicated only by turning text red, colorblind users may miss them. Supplement color with icons, text labels, or patterns. A red error message should also include a warning icon and descriptive text.

Form Accessibility

Forms are where accessibility issues are most frequently reported. Every input field needs a visible <label> element associated with it via the for attribute (or by wrapping the input inside the label). Placeholder text is not a substitute for labels -- it disappears when the user starts typing and is not reliably announced by screen readers.

Error messages should be programmatically associated with the input they describe using aria-describedby. When a form submission fails, focus should move to the first field with an error so the user knows where to fix the problem.

Images and Media

Every meaningful image needs an alt attribute that describes what the image conveys. Decorative images that add no information should have an empty alt="" to tell screen readers to skip them. For complex images like charts or infographics, provide a longer description either in surrounding text or via aria-describedby.

Videos should include captions for deaf and hard-of-hearing users. Audio content should have transcripts available.

Building accessible web apps

Testing for Accessibility

  • Use browser developer tools (Lighthouse, axe DevTools) for automated checks
  • Navigate your entire application using only the keyboard
  • Test with a screen reader (VoiceOver on macOS, NVDA on Windows)
  • Verify color contrast with tools like the WebAIM Contrast Checker
  • Test at 200% zoom to ensure the layout remains usable
  • Check that focus indicators are visible on all interactive elements

Quick Wins

These changes take minimal effort but significantly improve accessibility:

  • Add lang attribute to your <html> tag
  • Ensure all images have appropriate alt text
  • Associate every form input with a <label>
  • Add aria-label to icon-only buttons
  • Set a visible focus indicator style (do not use outline: none without a replacement)
  • Use role="alert" for dynamic error messages

Conclusion

Accessibility is not a feature you add at the end of a project -- it is a quality standard that should be present from the beginning. The improvements described in this guide are practical, well-established, and have a meaningful impact on millions of users who rely on assistive technologies.

When AI generates your application, review its accessibility. When you build manually, build accessibly from the start. Every user deserves to use your application, and the technical barriers to making that possible are lower than most developers assume.

この投稿をシェア
コメント
Esther Howard's avatar

Esther Howard

Until recently, the prevailing view assumed lorem ipsum was born as a nonsense text. It's not Latin though it looks like nothing.

返信

プロダクトの更新情報とヒントを受け取る

新機能、AIモデルのアップデート、開発のヒントを直接お届けします。

  • スパムは送りません

  • いつでも配信停止

  • プロダクトの更新情報 & ヒント