React Best Practices

Chapter 6 · Practice 4 of 4

Test every screen with the keyboard and an automated checker

From Accessibility

Why it matters

Accessibility problems are easy to miss with a mouse. Use two checks and add both to your definition of done for new UI.

CheckWhat it catches
Manual keyboard pass with Tab, Shift+Tab, Enter, Space and EscapeMissing focus styles, unreachable buttons, focus traps
Automated checker such as axe, in the browser or in testsMissing labels, low contrast, invalid ARIA

Unplug your mouse for five minutes and try to complete the main task on each screen.

Do

  • Run axe checks in component or end-to-end tests
  • Check color contrast against WCAG AA