{"canonical_url":"https://engineer.company/glossary/keyboard-navigation/","content_markdown":"# Keyboard navigation\n\n## What it is\n\nKeyboard navigation lets a person reach and operate an interface with keyboard\ninput. On a web page, the Tab key commonly moves among focusable elements. Shift\nand Tab can move in the reverse direction. Native controls provide expected ways\nto activate or adjust them. A link can be opened with the keyboard. A button\naccepts the activation behaviour the browser provides for it.\n\nSome components use additional keys within a group. A tab interface or listbox\ncan have one place in the ordinary Tab sequence and use arrow keys to move among\nrelated items. Its behaviour should follow a recognised pattern and remain\ndiscoverable to the user. When one element receives focus, the interface should\nmake its location apparent. The person should be able to follow the next action\nwithout relying on pointer hover.\n\nKeyboard access matters for people using a physical keyboard, switch input and\nother assistive technologies that operate through keyboard conventions. The\nuser's task determines the scope. A test should cover reaching the control,\nusing it, understanding changes and continuing to the next part of the\ninterface.\n\n## Why it matters\n\nA page can provide everything through pointer interaction while leaving a\nkeyboard user unable to reach an important action. A user may also reach an\nelement but find its focus indicator clipped or hidden. Both conditions\ninfluence whether the interface is usable. Check the actual rendered state and\nthe path a person follows, including controls that start out collapsed.\n\nOrder carries meaning. A person can expect to reach a section before its actions\nor pass through a group in the sequence shown on screen. A reordered layout can\nshow one order visually and another in the document's focus sequence. Follow the\ntask in both directions and compare what a person sees with what the keyboard\nreaches. Keep the order predictable as components wrap or their language\nchanges.\n\nSome failures become visible only once a control is open. A menu might include\nitems behind a clipped area. A disclosure can open but leave focus on a distant\npart of the page. A keyboard-only visit needs a way to enter, use and leave the\nopened area. Small states should be tested on their own and also as part of an\nactual visit.\n\n## What it looks like in practice\n\nOpen a representative page with the pointer out of the way. Start at the top and\npress Tab through the first controls. Confirm the location of focus, whether an\nactive highlight can be seen and which action the browser performs on\nactivation. Follow a link to another part of the same page and continue. The\nnext focus point should be easy to understand from the new position.\n\nExercise a menu or disclosure with the native keyboard commands applicable to\nit. Open it, move among the relevant choices and close it using its documented\nbehaviour. Then continue past it and check reverse navigation. For a composite\ncontrol with arrow-key selection, verify both the entry point and how the person\nleaves it using Tab. The test should retain the intended semantics of the\nunderlying widget.\n\nEngineer's [accessibility statement](/accessibility/) describes pressing real\nTab keys through representative pages, checking focus indicators, and using a\nfirst stop that leads directly to the content. It also records what the test\nscope covers. The example here builds on that method by checking open and closed\nstates and the user's continuation after activation. A good release check\nobserves the interaction at the actual viewport size and language.\n\nAdd a narrow layout and a short viewport to the same exercise. A sticky bar can\ncover an element the browser scrolls into view. A translated menu can grow\nlonger than expected. Use a viewport that exposes those interactions and record\nwhich target the user can see when they arrive at it. These conditions make\ntests more useful than counting focusable elements in the markup alone.\n\n## Where it goes wrong\n\nA control can be activated by clicking while lacking a working keyboard action.\nStart with the appropriate native element and verify the browser's activation.\nIf a custom widget adds keyboard behaviour, check the role, focus movement and\nstate changes together. An isolated key event is useful only when the user can\nreach the element and understand what happened.\n\nA common failure is a keyboard trap. A person can reach an interactive area and\nthen lack a usable way to leave it. Follow the complete key sequence after\nentering and test the exit path as carefully as the entry path. Modal interfaces\nintentionally constrain focus while open and need an available close operation\nand a reasonable next location afterward.\n\nAlso test the keyboard's interaction with text fields and scrolling areas. Arrow\nkeys can move a caret, choose a widget option or scroll a region depending on\nwhat has focus. Custom handling should preserve the expected action in each\ncontext. Use a real key sequence that starts outside the component, enters it\nthrough its normal path and continues after the last control. The fixture should\nshow what a person can do before the component gains focus and after it loses\nit.\n\nFinally, preserve keyboard checks when changing the visual design. Scrolling,\nanimation, responsive layout and fixed elements can alter the result without\nchanging the links in the document. A reliable fixture presses real keys and\nobserves the visible location and action. That evidence helps a team understand\nwhich part of an actual task a new layout makes easier or harder.\n\n## Further reading\n\n- [WCAG Keyboard](https://www.w3.org/WAI/WCAG22/Understanding/keyboard.html).\n  Explains how functionality should be operable through a keyboard interface.\n- [WCAG No Keyboard Trap](https://www.w3.org/WAI/WCAG22/Understanding/no-keyboard-trap.html).\n  Discusses entering and leaving interactive areas.\n- [WAI keyboard interface practices](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/).\n  Provides keyboard conventions for common widgets.\n\n\u003chttps://engineer.company/glossary/keyboard-navigation/\u003e\n","date_modified":"2026-11-25T07:18:46Z","description":"Follow focus through links, disclosures and grouped controls and test a complete keyboard task from the top of a page.","formats":{"gemtext":"https://engineer.company/glossary/keyboard-navigation/index.gmi","gopher":"https://engineer.company/glossary/keyboard-navigation/gophermap","html":"https://engineer.company/glossary/keyboard-navigation/","json":"https://engineer.company/glossary/keyboard-navigation/index.json","markdown":"https://engineer.company/glossary/keyboard-navigation/index.md","pdf":"https://engineer.company/glossary/keyboard-navigation/index.pdf"},"kind":"page","language":"en","title":"What is keyboard navigation?","url":"https://engineer.company/glossary/keyboard-navigation/","version":1}