Operable / 2.1 Keyboard Accessible
2.1.1Keyboard
Level AEnsure all functionality is operable via keyboard alone. Even custom mouse-oriented widgets must be reachable with Tab and operable with Enter, Space, or arrow keys.
APG Patterns Related to This Criterion
Correctly implementing these patterns helps meet this success criterion. See each page for implementation details, live demos, and Good / Bad examples.
Accordion
UpdatedAvailableA UI where pressing a heading toggles a panel open or closed. Uses a button with aria-expanded to convey the current state to assistive technologies.
Disclosure
AvailableThe simplest show/hide pattern, like a "show more" toggle that reveals or hides a single section.
Menu and Menubar
AvailableAn application-style menu built with role="menu" and related roles, navigated using arrow keys.
Menu Button
AvailableA button that opens a menu on activation. Uses aria-haspopup and aria-expanded to convey the relationship.
Link
AvailableThe fundamental yet nuanced link. Explains why you should use the a element instead of a div with onclick.
Button
AvailableThe most fundamental control. Covers the built-in accessibility the button element provides and the pitfalls of custom implementations.
Checkbox
AvailableAn on/off selection control. Also covers handling the indeterminate (mixed) state.
Radio Group
AvailableSelects one option from many. A prime example of arrow key navigation with roving tabindex.
Switch
AvailableAn on/off toggle. Covers the difference from checkbox and how to use role="switch".
Combobox
AvailableA text input combined with a suggestion list (autocomplete). One of the most complex patterns in the APG.
Listbox
AvailableSelecting from a list of options. Supports single and multi-select with arrow key navigation.
Slider
AvailableSelects a value from a range. Uses aria-valuenow/min/max with keyboard operation.
Slider (Multi-Thumb)
AvailableRange selection such as price ranges. Key considerations include thumb interaction constraints and labeling.
Spinbutton
AvailableA numeric input that increments and decrements via Up/Down keys or buttons, with range announcements.
Tabs
AvailableSwitches content within the same area. Uses arrow key navigation, aria-selected, and roving tabindex.
Toolbar
AvailableGroups a set of buttons so you Tab in once and navigate among them with arrow keys.
Grid
UpdatedAvailableAn interactive table (data grid) where individual cells are keyboard-navigable.
Treegrid
AvailableA grid with expandable and collapsible rows. A composite of tree and grid patterns.
Tree View
AvailableDisplays a hierarchical structure. Supports expand/collapse and navigation similar to a folder tree.
Carousel
AvailableAutomatically rotating slides. Play/pause controls and screen reader considerations are essential.
Window Splitter
AvailableA resize handle that moves the boundary between two panes via drag or keyboard.
Normative References
- Success Criterion 2.1.1 Keyboard — WCAG 2.2(opens in a new tab)The normative requirement text.
- Understanding Keyboard — W3C(opens in a new tab)Official guidance on intent, examples, and techniques.