Skip to content
界面图谱Interface Atlas
☰
中文
ComponentsNavigation / Overlay

Menu

菜单

Aliases:菜单下拉菜单右键菜单上下文菜单操作菜单更多操作三个点点出来的菜单

What is it

A temporary overlay listing actions, opened by click or right-click: flat or grouped command items that execute and close on selection. It houses infrequent actions (more, settings, delete), usually behind a "⋯" button or a context click.

Name disambiguation

A menu lists commands that run on click. Navigation (Navbar/Sidebar) lists destinations. A dropdown is the combined control — a button plus a menu.

Interactive playground

Try it. Make an informed choice.

Try pointer and keyboard actions, rename, confirm deletion and undo.

Loading lab…

What to look for

  • 01Every action, including destructive ones, must be keyboard reachable.
  • 02Outside click and Escape should dismiss without losing focus.

From reference to practice

AI-generated visual references · Open the full collection

✓ When to use

  • Stash infrequent actions instead of crowding buttons
  • Context actions on right-click (files, canvas items)
  • Site section entry points in a top nav

✕ When not to use

  • Frequent primary actions — expose real buttons
  • Very deep trees — use a sidebar or command palette
  • Destructive items need confirmation, not one-click firing

Variants

Dropdown

下拉

Opens below its trigger button

Context

上下文

Opens at the pointer on right-click

Grouped

分组

Group labels with separators

Implementation

position: absolutez-indexbox-shadowmin-width

Anchor to the trigger with absolute positioning, opening below by default and flipping near screen edges. Items are buttons with role="menuitem"; ↑↓ cycles, Enter executes, Esc closes; destructive items get red text and a separator before them. Close on outside click: listen for pointerdown on document and check the target.

Platform API

role="menu"role="menuitem"
Menu菜单Navbar顶部导航栏Sidebar侧边栏
Space footprintLow — hidden until invokedLow — one top stripHigh — persistent width
Layer capacityMedium — two levels at mostLow — mostly one flat levelHigh — multi-level tree
Mobile friendlyMedium — needs larger touch targetsMedium — folds into a hamburgerPoor — becomes a drawer

Related concepts

Dropdown下拉菜单

A menu of actions popping near its trigger to tuck away secondary operations and keep the interface tidy — the classic form being a "···" more button. The panel floats over content with a shadow; picking an item executes and closes, and destructive actions sit isolated below a divider in red.

ComponentsSimilar
Navbar顶部导航栏

A horizontal navigation bar pinned to the top of the page: brand on the left, primary links in the middle, search, actions and avatar on the right. It is the front door of a site — the 3–7 most important destinations compressed into one strip, folding into a hamburger menu on mobile. Usually kept visible with position: sticky.

ComponentsAlternative
Command Palette命令面板

A floating search panel summoned with ⌘K / Ctrl+K: type to filter commands, pages or content, navigate with arrow keys, execute with Enter. Popularized by macOS Spotlight; now standard in power-user products.

ComponentsSimilar
Popover气泡卡片

A non-modal layer that pops up beside its trigger on click, carrying medium-complex content such as text, a mini-form or a date picker. No backdrop and no blocking of the rest of the page; clicking outside or pressing Esc closes it.

ComponentsSimilar

Not to be confused with

Dropdown下拉菜单

Dropdown is the full button+menu control; Menu is only the popup command list.

Navbar顶部导航栏

Navbar jumps to destinations; Menu runs immediate commands.

Select下拉选择

Select picks a value for a form; Menu triggers an action.

Applicable styles

Sources

Markdown for agents · JSON