Keyboard accessibility is one of the most important — and most neglected — aspects of web accessibility. An estimated 2.5 million Americans have motor disabilities that prevent mouse use. If your site can't be operated entirely by keyboard, you're excluding them completely.
The Four Core Principles
WCAG 2.2 Principle 2 (Operable) contains the keyboard requirements:
2.1.1 Keyboard (AA): All functionality must be operable via keyboard
2.1.2 No Keyboard Trap (AA): If focus moves into a component, it must be possible to move it out
2.4.3 Focus Order (AA): If page can be navigated sequentially, order must be logical and predictable
2.4.7 Focus Visible (AA): Any keyboard-operable UI must have a visible focus indicator
2.4.11 Focus Appearance (AA, new in 2.2): Focus indicator must meet size and contrast requirements
Testing Without Automated Tools
Start with the basic keyboard test:
Unplug (or ignore) your mouse
Press Tab to move forward through interactive elements
Press Shift+Tab to move backward
Use…