Menu
The menu component displays a list of actions that can be performed on a resource or within a specific context. Use menu to present multiple related actions in a compact dropdown format, reducing visual clutter while maintaining discoverability.
Menus support action grouping, icons for visual clarity, and keyboard navigation for efficient interaction.
Anchor to PropertiesProperties
Configure the following properties on the menu component.
- stringstringrequiredrequired
A label that describes the purpose or content of the component for assistive technologies like screen readers. Use this to provide additional context when the visible content alone doesn't clearly convey the component's purpose.
Anchor to SlotsSlots
The menu component supports slots for additional content placement within the component. Learn more about using slots.
- HTMLElementHTMLElement
The items displayed within the menu. Only accepts button and section components. Use button for individual menu actions and section to group related items.
Anchor to ExamplesExamples
Add a dropdown menu of actions triggered by a button. This example shows a menu with three icon buttons including a critical delete action.
Preview
html
Anchor to Organize items into sectionsOrganize items into sections
Organize menu items into labeled groups so merchants can find related actions. This example shows two sections with headings separating product actions from export options.
Preview
html
Mix link-based, standard, and disabled buttons in a single menu. This example shows a menu with a link that opens in a new tab, a disabled action, and a download link.
Preview
html
Anchor to Mix sections with root-level actionsMix sections with root-level actions
Combine sections with root-level items to separate grouped actions from standalone ones like a destructive action. This example shows two sections for customer management alongside a root-level delete button.
Preview
html
Build a settings-style menu with multiple sections and a standalone action at the bottom. This example shows account and store settings sections with a root-level sign-out link.
Preview
html
Use an icon-only button as the menu trigger for a compact "more actions" pattern. This example shows a three-dot icon button that opens a menu with common product actions.
Preview
html
Anchor to Best practicesBest practices
- Reserve for secondary actions: Place primary actions directly in the UI (like Save in the page header). Use menus for less frequent or destructive actions (like Archive, Duplicate, or Export data) that shouldn't take up permanent space.
- Write action-oriented labels: Use the
{verb}+{noun}format: Edit details, Export as CSV, Duplicate product, Archive order. Never use vague labels like Options, More, or Settings. - Group related actions with sections: When you have 4+ menu items, organize into sections with headings: group Edit details, Duplicate product under Manage, and Archive product, Delete product under Danger zone.
- Use icons to reinforce meaning: Add icons to menu items to provide visual recognition: use an edit icon for Edit, trash icon for Delete, or download icon for Export. Icons should clarify, not replace, text labels.
- Only disable temporarily unavailable actions: Use disabled items when an action's contextually unavailable (like Refund order when already refunded). If an action's never available, remove it from the menu entirely.
Anchor to LimitationsLimitations
- Menus automatically reposition to stay within the viewport boundaries, but in extremely constrained spaces (like narrow mobile screens or small modals), the menu might partially overflow or be cut off.
- While there's no hard technical limit on menu items, menus with more than 10-12 items become difficult to scan. Performance remains acceptable up to ~50 items, but beyond this, consider pagination, search, or alternative UI patterns.
- The component doesn't support nested submenus (like cascading dropdowns). All menu items must be at a single level, organized into sections if needed.
- When navigating with arrow keys, focus moves sequentially through all items regardless of section boundaries. Section headings aren't focusable and serve only as visual separators.
- The menu renders in a popover layer with a specific z-index. If placed within containers that have their own stacking contexts (like modals, sticky headers, or elements with transforms), the menu might appear behind other elements or clip unexpectedly.