Keyboard Accessibility
Keyboard accessibility enables every interactive function to be reached and operated through keyboard input without traps or pointer-only actions.
Download Markdown (.md)Soroush’s Product Wiki · https://wiki.soroush.uk/topic/keyboard-accessibility/
01What it means
Keyboard-accessible interfaces provide a logical path among controls, visible focus, expected keystrokes, and a way to leave every component. Native HTML controls supply much of this behavior; custom widgets must deliberately reproduce the relevant keyboard conventions and semantics.[1][2][3]
- 01Enter taskLogical DOM and visible focus
- 02Move betweenTab and Shift + Tab
- 03Operate withinConventional arrows, Enter, Space, Escape
- 04Alternative actionsNo timed, drag-only, or path-only requirement
- 05Exit + completeNo keyboard trap; all outcomes reachable
Native controls supply established semantics and keystrokes; custom widgets must deliberately reproduce the relevant convention.
02Why it matters
People with motor or visual disabilities may rely on keyboards, switches, voice input, or other technologies that generate keystrokes. Keyboard testing also exposes missing semantics, hidden controls, focus bugs, and interactions coupled incorrectly to a mouse or touch gesture.
03When to use it
Test keyboard access for every flow and after changes to navigation, overlays, drag-and-drop, custom controls, shortcuts, or dynamic content. Include both sequential Tab navigation and component-specific keys such as arrows, Escape, Enter, and Space.
04How it works
- Start with semantic native controls and meaningful DOM order.
- Ensure all actions have keyboard equivalents that do not require timed keystrokes.
- Use Tab and Shift+Tab between components and conventional keys within composite widgets.
- Keep focus visible and never create a keyboard trap.
- Provide alternatives for pointer gestures such as dragging or path-based movement.
- Test complete tasks using only a keyboard and document custom commands.
05A practical example
A sortable task list supports arrow-key movement plus explicit “Move up” and “Move down” buttons, announces the new position, and preserves focus on the moved item. A user can complete the task without reproducing a drag gesture.
06Where it breaks
Keyboard operation alone does not ensure useful semantics or a good screen-reader experience. Custom widgets can technically respond to keys while violating established expectations, and shortcuts may conflict with browsers, operating systems, or assistive technology.
Common mistakes
- Adding tabindex="0" to noninteractive elements without implementing behavior.
- Using positive tabindex values to force a fragile order.
- Removing focus outlines without a strong replacement.
- Testing Tab navigation but not activation, Escape, arrows, or focus return.
07Sources
- Understanding Guideline 2.1: Keyboard AccessibleW3C Web Accessibility Initiative · Standards guidanceUnderstanding Guideline 2.1: Keyboard Accessible
- Developing a Keyboard InterfaceW3C Web Accessibility Initiative · Technical guidanceDeveloping a Keyboard Interface
- Understanding Success Criterion 2.4.3: Focus OrderW3C Web Accessibility Initiative · Standards guidanceUnderstanding Success Criterion 2.4.3: Focus Order