How can I build a website menu that works with both keyboard and pointer?
Quick answer
For links that take people to pages or sections of your site, use a conventional navigation list with ordinary links. Don’t add application-style menu behavior just because the design is called a menu. Choose that widget pattern when the interface offers menu-like commands and genuinely needs its interaction model; it brings additional keyboard and focus requirements. Test the chosen pattern with both keyboard and pointer, including opening, choosing, and leaving it.
The question, the details, the next step.
A practical checklist
Write down whether each item leads to a site destination or performs an application action.
Use a conventional list of ordinary links for site navigation unless the interaction genuinely calls for an application-style menu.
List the pointer tasks: reach the control, open any panel, choose an item, and dismiss or move away as intended.
Repeat the task list with a keyboard; check that choices can be reached and activated and that users can leave and continue.
If using an application-style menu, explicitly test managed focus, arrow-key navigation, and leaving with Tab or Shift+Tab.
Record unclear behavior and review the implemented interface, not just the design.
A few more useful answers
Does a dropdown automatically need application-style menu behavior?
What is the main keyboard difference with an application-style menu?
The described menu pattern uses managed focus and arrow-key navigation, while Tab and Shift+Tab leave the menu rather than moving among its items. [S2]
What should I do if I cannot tell which pattern fits?
Describe what each item does and what a person should be able to accomplish, then compare that purpose with the navigation-list and application-menu distinction. The guidance does not determine the right answer for every custom interface, so seek an accessibility review if the interaction remains ambiguous.
Sources
References used for this guide.
- [S1] WAI Menus Tutorial: Menu Structure w3.org · Checked
- [S2] WAI-ARIA Authoring Practices: Menu and Menubar Pattern w3.org · Checked
