Keyboard focus: make the path visible
Design keyboard focus as a visible state that can be followed through an interface. Shape the indicator, test its contrast and placement, and check that fixed layers do not hide the control receiving focus.
Treat focus as part of the composition
Keyboard focus is the interface’s answer to “where will the next action happen?” A pointer can travel directly to a button, but a keyboard user often moves through an ordered sequence. If the active control has no visible change, the interface withholds a useful piece of visual information. Plan focus alongside hover, pressed, selected, and disabled states instead of adding it as a last-minute decoration.
Start with the interaction path, not a ring color. Sketch the controls in the order a person can reach them and mark what the design should reveal at each stop. A visible border, offset outline, or change in fill can work; the form is a design choice, while the user’s ability to locate the current control is the goal. Keep the indicator persistent while focus remains there, rather than making it flash briefly.
Separate visibility from contrast
The W3C’s WCAG 2.2 Success Criterion 2.4.7, Focus Visible, is a Level AA requirement: keyboard-operable interface controls need a mode in which the focus indicator is visible. That criterion does not prescribe one universal shape or size. WCAG 2.2 also has a separate Level AAA criterion, Focus Appearance, with more specific expectations for indicator area and contrast. Treat these as related design questions, not as one interchangeable rule.
Contrast still matters in a practical review. An outline that blends into both the page and the control can be technically present yet hard to find. Try the same indicator over the different surfaces it will encounter: a pale card, a dark button, a photograph, or a colored navigation bar. A two-color edge or a small contrasting offset can stay distinct across more backgrounds, but check the actual combinations rather than assuming a style is universally visible. Do not remove a browser’s useful default until the replacement has been checked.
Keep the focused control in view
An indicator cannot help if the control itself has been pushed behind a sticky header, cookie banner, or floating panel. WCAG 2.2 Success Criterion 2.4.11, Focus Not Obscured (Minimum), is Level AA and requires that a focused component not be entirely hidden by author-created content. The threshold allows partial obstruction; a clearer design aims to keep both the control and its indicator unobstructed when the page scrolls.
This turns focus design into a layout exercise. Test long pages, narrow viewports, zoomed text, and expanded menus. A fixed footer that seems harmless at the top can cover the next control after tabbing near the bottom. Adjust scroll spacing, let the content reflow, or change how the overlay opens. For each correction, confirm that focus order remains understandable and that a person can still find the control after the page moves.
Review the sequence, not one screenshot
A static mockup shows the appearance of one state; it cannot show whether the state follows the actual keyboard route. In a prototype or implementation, use the keyboard to move forward and backward through links, buttons, fields, menus, and dialogs. Watch for controls that are skipped, repeated unexpectedly, or focused behind another layer. These observations are design checks, not a complete conformance assessment or a substitute for testing with people who use different input methods.
Record the intended indicator and the edge cases together. If the indicator changes on a dark surface, note the alternate treatment. If a modal dialog traps focus by design, specify where focus begins and where it returns when the dialog closes. The result is a small state system: visible enough to follow, consistent enough to learn, and flexible enough to survive the layouts the interface actually uses.
Try it yourself
- Choose a small interface such as a workshop sign-up form and list every control in keyboard order.
- Draw a focus state for each control, then test it on every background and component color in the layout.
- Add a sticky header or footer to the prototype and check whether any focused control becomes fully hidden while tabbing.
- Revise the indicator or layout, then repeat the forward and backward keyboard path at a narrow viewport and enlarged text size.
Worked example: a fictional workshop booking form
Imagine a fictional drawing workshop form with a name field, an email field, a session selector, a consent checkbox, and a “Reserve a place” button. Draw five frames, each showing the next control after a Tab press. Give every focused control a dark outline with a light gap around it; then place the frames over cream form panels and a cobalt footer to see where that treatment loses separation. In a second pass, add a sticky footer with a confirmation link and scroll to the final fields. If it covers the button or its indicator, move the footer out of the way or reserve enough scrolling space. Finish by checking the path backwards with Shift+Tab. The form and its behavior are invented for this exercise; it reports no user test or conformance result.
References & further reading
- W3C: Web Content Accessibility Guidelines (WCAG) 2.2 Recommendation ↗
- W3C WAI: Understanding Success Criterion 2.4.7, Focus Visible ↗
- W3C WAI: Understanding Success Criterion 2.4.11, Focus Not Obscured (Minimum) ↗
Examples and exercises in this guide are original teaching scenarios.