How can I support keyboard navigation in a single-page website?
Quick answer
After a single-page website changes views, make the new view identifiable and decide deliberately whether focus should move. For a substantial route change, consider moving focus to the new view’s main heading; for a small update, keeping focus where it is may better preserve the user’s place. Update the document title when the view changes, and test the result with keyboard navigation. These are practical design choices, not a complete route-change standard.
The question, the details, the next step.
A practical checklist
Classify each view change as a substantial route change or a small update.
Choose and document the intended focus target, or explicitly decide to retain focus.
Give each view a clear main heading and update the document title for significant changes.
Check keyboard focus order after in-app navigation and after directly loading a route.
Record expected and observed focus, heading, title, and Tab sequence for each test path.
A few more useful answers
Should every route change move focus to the main heading?
Not necessarily. Consider that for a substantial view change, but assess small updates separately so a user is not moved unnecessarily. The cited guidance does not prescribe a universal focus target.
Does changing the document title make focus management unnecessary?
No. A descriptive title can help identify the view, while focus behavior and keyboard order still need their own deliberate plan and checks.
Is testing a route only by clicking an in-app link enough?
No. Include direct loading as a separate test path. Check the heading, title, focus position, and subsequent Tab order.
Sources
References used for this guide.
- [S1] MDN: The HTML title element and accessibility developer.mozilla.org · Checked
- [S2] MDN: Operable accessibility guidance developer.mozilla.org · Checked
