FresherTechnicalAccessibility
What does keyboard accessibility mean, and which keys do users expect to work?
Try answering first
Model answer
Keyboard accessibility means every feature can be used without a mouse (WCAG 2.1.1). People who rely on it include screen reader users, people with motor disabilities, switch device users and power users.
The keys users expect:
TabandShift+Tab: move forward and backward between interactive elements.Enter: activates links and buttons.Space: activates buttons, toggles checkboxes and scrolls the page.- Arrow keys: move inside groups such as radios, tabs, menus and lists.
Esc: closes dialogs, menus and popups.HomeandEnd: jump to the first or last item in a list.
What makes it work:
- Use native elements (
button,a href,input), which are focusable and keyboard-ready. - Keep a visible focus indicator (WCAG 2.4.7).
- Keep a logical focus order that matches the visual order.
- Never create a keyboard trap: users must be able to leave every component.
- Avoid positive
tabindexvalues.
Try it yourself: unplug the mouse and complete a task on your own page.
Key points
- Every feature must work without a mouse
- Tab, Enter, Space, arrows and Esc are the expected keys
- Native elements give keyboard support for free
- Focus must be visible, logical and never trapped
Likely follow-ups
- What is the difference between Enter and Space on a button?
- Why should you avoid positive tabindex values?
Common mistakes
- Removing the focus outline without a replacement
- Building clickable elements that only respond to the mouse