WCAG
Keyboard Accessibility: Making Websites Usable Without a Mouse
Contents
Many people never use a mouse to operate websites. People with motor impairments, blind users who work with screen readers, people with tremors—and many experienced users—navigate with a keyboard. If a website only works with a mouse, it excludes these groups. The WCAG therefore make keyboard accessibility a fundamental requirement. This article explains what is required, how keyboard navigation works, and how you can test it yourself in just a few minutes. For a general explanation of the WCAG, see the WCAG Guide.
Why keyboard accessibility matters
Many people depend on a keyboard: those who cannot control a mouse precisely, blind users who operate a screen reader through keyboard commands, and people with tremors or repetitive strain pain. Keyboard accessibility is also the foundation of screen-reader use—anything that cannot be operated with a keyboard generally cannot be used with a screen reader either. This is therefore not an edge case, but a fundamental requirement.
What the WCAG require
Several success criteria address keyboard accessibility:
- All functionality must be operable using a keyboard (2.1.1, Level A).
- There must be no keyboard traps—users must be able to move away from every element (2.1.2, Level A).
- The focus order must be logical (2.4.3, Level A).
- Keyboard focus must be visible (2.4.7, Level AA).
- A skip link should allow users to bypass repeated blocks of content (2.4.1).
WCAG 2.2 added the requirement that focus must not be hidden behind fixed elements (2.4.11). Most of these criteria are at Level A, while visible focus is at Level AA—all within the AA framework relevant to the BFSG. See WCAG Conformance Levels.
The fundamentals of keyboard operation
Users expect familiar keyboard patterns, which custom components must also follow. The Tab key moves forward through interactive elements, while Shift and Tab move backwards. Enter and the Space bar activate links and buttons. Within a component—such as a group of options, menu, or slider—the arrow keys are used for navigation. Escape closes dialogs and menus.
The keyboard test: how to check it yourself
Put the mouse aside and navigate using only the keyboard. Pay attention to five things: Can you reach every interactive element? Is the focus always visible? Does the order follow the visual layout—from top to bottom and left to right? Can you activate everything and move away from every element without encountering a trap? Do dialogs retain focus while open and return it to a logical position when closed?
This test takes only a few minutes and reveals many accessibility issues. See Accessibility Testing to learn how it fits into a complete accessibility assessment.
Common problems
- Custom controls built from non-semantic elements, such as clickable
divs, that cannot be focused or operated with a keyboard. - A focus indicator removed with CSS—for example,
outline: none—without a visible replacement. - An illogical focus order caused by visually rearranging elements with CSS.
- Keyboard traps in dialogs, embedded content, or third-party widgets.
- Unmanaged focus when opening and closing dialogs, causing users to lose their position.
Automated tools can identify some of these problems, such as elements that cannot receive focus. However, they cannot reliably determine whether the focus order is logical or whether a custom component actually works correctly. Learn more in Automated WCAG Testing.
Frequently Asked Questions
How do I test keyboard accessibility?
Put the mouse aside and navigate using only Tab, Enter, and the arrow keys. Check whether you can reach everything, the focus is visible, the order is logical, and there are no keyboard traps.
Which WCAG level does this relate to?
Keyboard operability and focus order are Level A requirements, while visible focus is Level AA—all within the AA framework relevant to the BFSG.
Why can’t some elements be operated with a keyboard?
Often because they were built using non-semantic elements. Native buttons and links are keyboard-accessible by default, while custom-built controls often are not.
Updated: . This article gives a general overview. Not legal advice.