An interactive button for multi-item actions, selection, or navigation.
Default
A simple button designed to be placed in a menu of available options or actions.
Editable example
<Card>
<Stackgap="xxs"padding="s">
<MenuItem>Option 1</MenuItem>
<MenuItem>Option 2</MenuItem>
<MenuItem>Option 3</MenuItem>
</Stack>
</Card>
Best practices
For and use the respective OptionMenuItem and SelectOption components as they wrap this MenuItem component and provide additional component-specific behaviors.
Use a to divide menu items into groups or to separate destructive menu items from non-destructive options.
Size
The default medium menu item should fit most cases. Use the smaller sizes for more compact menus triggered by smaller controls.
Editable example
<Card>
<Stackgap="s"padding="s">
<MenuItemsize="xs">Extra small menu item</MenuItem>
<Separator/>
<MenuItemsize="s">Small menu item</MenuItem>
<Separator/>
<MenuItemsize="m">Medium menu item</MenuItem>
<Separator/>
<MenuItemsize="l">Large menu item</MenuItem>
</Stack>
</Card>
Icons and elements
To place content at the starr and end of the menu item, such as an icon, use the startElement and endElement props.
Use the selected prop to indicate a selected menu item. If multiple items are selectable, also set the multiselect prop to true so that the correct accessibility roles and attributes are applied for multiple selection.
Make the menu item text bolder. Use this for menus that need a stronger visual emphasis, such as primary navigation menus. Be sure to use it for all items in the menu and avoid using it on a single item among others in the same menu.
Editable example
<Card>
<Stackgap="xxs"padding="s">
<MenuItem>Regular menu item</MenuItem>
<MenuItemstrong>Strong menu item</MenuItem>
</Stack>
</Card>
Link
Link to a webpage using the href prop. You can also specify the target and rel for the link if you provide an href.
Editable example
<Card>
<Stackgap="xxs"padding="s">
<MenuItemstartElement={<Popout/>}href="https://qwilr.com">Link menu item</MenuItem>
</Stack>
</Card>
Destructive
Use for destructive actions like deletion. Applies a red hover style to emphasize the destructiveness of the action.
Editable example
<Card>
<Stackgap="xxs"padding="s">
<MenuItemdestructivestartElement={<Delete/>}>Destructive menu item</MenuItem>
</Stack>
</Card>
Accessibility
When using the selected prop MenuItems default to using the single select accessibility attributes. Remember to set the multiselect prop for menu items where more than one can be selected. This only changes the accessibility attributes to communicate that the menu items are multi select instead of single select.