Menu

Menu API

The API documentation of the Menu React component. Learn more about the properties and the CSS customization points.

import Menu from '@material-ui/core/Menu';

Props

Name Type Default Description
anchorEl union: object |
 func
The DOM element used to set the position of the menu.
children node Menu contents, normally MenuItems.
classes object Override or extend the styles applied to the component. See CSS API below for more details.
disableAutoFocusItem bool false If true, the selected / first menu item will not be auto focused.
MenuListProps object Properties applied to the MenuList element.
onClose func Callback fired when the component requests to be closed.

Signature:
function(event: object, reason: string) => void
event: The event source of the callback
reason: Can be:"escapeKeyDown", "backdropClick", "tabKeyDown"
onEnter func Callback fired before the Menu enters.
onEntered func Callback fired when the Menu has entered.
onEntering func Callback fired when the Menu is entering.
onExit func Callback fired before the Menu exits.
onExited func Callback fired when the Menu has exited.
onExiting func Callback fired when the Menu is exiting.
openĀ * bool If true, the menu is visible.
PopoverClasses object classes property applied to the Popover element.
transitionDuration union: number |
 { enter?: number, exit?: number } |
 enum: 'auto'

'auto' The length of the transition in ms, or 'auto'

Any other properties supplied will be spread to the root element (Popover).

CSS

You can override all the class names injected by Material-UI thanks to the classes property. This property accepts the following keys:

Name Description
paper Styles applied to the Paper component.

Have a look at overriding with classes section and the implementation of the component for more detail.

If using the overrides key of the theme, you need to use the following style sheet name: MuiMenu.

Inheritance

The properties of the Popover component are also available. You can take advantage of this behavior to target nested components.

Demos