Menu2 API
API reference docs for the React Menu2 component. Learn about the props, CSS, and other APIs of this exported module.
Demos
Import
import Menu from '@mui/material/Unstable_Menu2';Controls a menu without rendering a DOM element.
Use MuiMenu2.defaultProps to set behavior defaults in the theme.
| Name | Type | Default | Description |
|---|---|---|---|
| actionsRef | { current?: { close: func, unmount: func } } | - | A ref to imperative actions.
|
| children | node | - | The menu trigger and popup. |
| defaultOpen | bool | false | Whether the menu is initially open. |
| disabled | bool | false | Whether the component should ignore user interaction. |
| highlightItemOnHover | bool | true | Whether moving the pointer over items should highlight them. Disabling this prop allows CSS |
| loopFocus | bool | true | Whether to loop keyboard focus back to the first item when the end of the list is reached while using the arrow keys. |
| modal | bool | true | Determines if the menu enters a modal state when open.
On touch devices, a Nested menus ignore this prop, and menus opened by hover are never modal. |
| onOpenChange | func | - | Event handler called when the menu is opened or closed. Signature: function(open: boolean, eventDetails: object) => void
|
| onOpenChangeComplete | func | - | Event handler called after the opening or closing animation completes. Signature: function(open: boolean) => void
|
| open | bool | - | Whether the menu is currently open. |
Source code
If you did not find the information in this page, consider having a look at the implementation of the component for more detail.