Skip to main content
Kaleidoscope

MenuItem

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

Best practices

  1. For and use the respective OptionMenuItem and SelectOption components as they wrap this MenuItem component and provide additional component-specific behaviors.
  2. 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

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.

Editable example

Selection

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.

Editable example

Active

For navigation items such as pages in a sidebar, use the active prop to indicate the current page.

Editable example

Strong

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

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

Destructive

Use for destructive actions like deletion. Applies a red hover style to emphasize the destructiveness of the action.

Editable example

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.