Use when implementing expand and collapse content sections.
中文简介正在准备中。当前显示原文说明。
Use when you need to organize and structure site navigation.
中文简介正在准备中。当前显示原文说明。
查看安装方法安装前可以查看交给 AI 代理的指令内容。
Organize and structure site navigation
Navigation Menu is the primary horizontal or vertical bar of links that helps users move between the main sections of a website or application. It is the backbone of site architecture, giving users a persistent map of what the site offers and where they currently are. A well-built navigation menu balances visibility, hierarchy, and responsiveness — always adapting to viewport size while remaining accessible to keyboard and screen reader users.
Use Navigation Menu to provide persistent, structured access to the main sections of a website or app. Common scenarios include:
references/pattern.md, then choose the smallest viable variation.Do's ✅
<nav> element with aria-label for screen reader landmark navigationaria-current="page" on the active link<button> with aria-expanded and aria-haspopup for dropdown triggers<div> with click handlers instead of semantic <nav>, <ul>, <a>, or <button><nav> elements without distinct aria-label valuesposition: sticky not JavaScript-based)Semantic HTML (No JS Needed for Basic Nav)```html
<nav aria-label="Main navigation"> <ul>The Problem: Cramming 10+ items into the primary navigation bar causes wrapping, overflow, or truncated labels.
How to Fix It: Limit to 5-7 top-level items. Group excess items under broader categories or move them to a secondary navigation bar.
The Problem: Users can't tell which page they're on because no navigation item is visually highlighted.
How to Fix It:
Style the current page's navigation link distinctly (color, weight, underline) and add aria-current="page" for screen readers.
The Problem: Keyboard users and touch-device users cannot access dropdown submenus that only respond to mouse hover.
How to Fix It: Use click/tap to toggle dropdowns. Support Enter/Space to open and Escape to close for keyboard users.
For full implementation detail, examples, and testing notes, see references/pattern.md.
Pattern page: https://uxpatterns.dev/patterns/navigation/navigation-menu
还没有评价。欢迎分享你的使用感受。
无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。
还没有评论。来写第一条吧。
Use when implementing expand and collapse content sections.
中文简介正在准备中。当前显示原文说明。
Use when implementing user account configuration and preferences.
中文简介正在准备中。当前显示原文说明。
Use when implementing social activity and updates stream.
中文简介正在准备中。当前显示原文说明。
Use when implementing conversational AI chat interfaces.
中文简介正在准备中。当前显示原文说明。
Use when implementing handling AI-specific errors.
中文简介正在准备中。当前显示原文说明。
Use when implementing loading states for AI operations.
中文简介正在准备中。当前显示原文说明。