Vijay Singh
Back to Blogs
A11y
Nov 15, 2024
9 min read

Building Accessible Web Applications

Beyond ARIA labels: Logical heading structures, keyboard navigation, and designing for screen readers from day one.

Building Accessible Web Applications

Web Accessibility (a11y) means creating websites that can be used by everyone, including people with vision, motor, or cognitive impairments. It's often treated as an afterthought, but it should be a core engineering principle.

The "Semantic HTML" Foundation

The easiest way to be accessible is to standard HTML elements. A <button> gives you click handlers, keyboard focus, and screen reader announcements for free. A <div onClick> gives you nothing.

Bad: <div class="btn">Submit</div>
Good: <button class="btn">Submit</button>

Keyboard Navigation

Power users and those with motor disabilities rely on the keyboard.

  • Focus Indicators: Never remove the default CSS outline (outline: none) without replacing it with a custom focus style. If you can't see where you are tabbing, the site is unusable.
  • Tab Order: Ensure the tab order matches the visual reading order.
  • Skip Links: Add a "Skip to Content" link at the top so keyboard users don't have to tab through your entire navigation menu on every page.

ARIA (Accessible Rich Internet Applications)

ARIA is a bridge when HTML falls short. However, The First Rule of ARIA is: Don't use ARIA if a native element exists. Use it for complex widgets like Tabs, Modals, or Dropdowns to communicate state (e.g., aria-inExpanded="true") to screen readers.

Testing Tools

  • Lighthouse: Built into Chrome DevTools.
  • axe-core: Automated testing library you can run in your CI/CD.
  • Screen Readers: Actually try using NVDA (Windows) or VoiceOver (Mac) on your site. It's an eye-opening experience.
A11yAccessibilityHTML
Vijay Kumar Singh | Frontend Engineer