menu

v4.9.10arrow_drop_down
v4.9.10
v4.5.2
v3.9.2
STATUS
Passing
DOWNLOADS
37,390
LICENSE
MIT
VISIBILITY
Public
PUBLISHED
4 years ago
SIZE
37 KB
Menus display a list of choices on temporary surfaces.
2 contributors
Install menu as a package?
Copied
npm i @bit/mui-org.material-ui.menu
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.cloud
Component Example
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
import
any of the 1 million components
and packages in Bit or NPM to the example.
import Button from '@bit/grommet.grommet.button';
import Lodash from 'lodash';
toggle layout
modifieddraft
modifieddraft
modifieddraft
modifieddraft
modifieddraft
modifieddraft
modifieddraft
modifieddraft
modifieddraft
chevron_left
chevron_right

The DOM element used to set the position of the menu.

If true (Default) will focus the [role="menu"] if no focusable child is found. Disabled children are not focusable. If you set this prop to false focus will be placed on the parent modal container. This has severe accessibility implications and should only be considered if you manage focus otherwise.

Menu contents, normally MenuItems.

When opening the menu will not focus the active item but the [role="menu"] unless autoFocus is also set to false. Not using the default means not following WAI-ARIA authoring practices. Please be considerate about possible accessibility implications.

Props applied to the MenuList element.

Callback fired when the component requests to be closed.

Callback fired before the Menu enters.

Callback fired when the Menu has entered.

Callback fired when the Menu is entering.

Callback fired before the Menu exits.

Callback fired when the Menu has exited.

Callback fired when the Menu is exiting.

If true, the menu is visible.

classes prop applied to the Popover element.

The length of the transition in ms, or ‘auto’

The variant to use. Use menu to prevent selected items from impacting the initial focus and the vertical alignment relative to the anchor element.

Demos:

API:

Properties
NameTypeDescription
anchorEl
function | typeof Element === 'undefined' ? Object : Element

The DOM element used to set the position of the menu.

autoFocus
bool

If true (Default) will focus the [role="menu"] if no focusable child is found. Disabled children are not focusable. If you set this prop to false focus will be placed on the parent modal container. This has severe accessibility implications and should only be considered if you manage focus otherwise.

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

When opening the menu will not focus the active item but the [role="menu"] unless autoFocus is also set to false. Not using the default means not following WAI-ARIA authoring practices. Please be considerate about possible accessibility implications.

MenuListProps
object

Props applied to the MenuList element.

onClose
function

The event source of the callback.

onEnter
function

Callback fired before the Menu enters.

onEntered
function

Callback fired when the Menu has entered.

onEntering
function

Callback fired when the Menu is entering.

onExit
function

Callback fired before the Menu exits.

onExited
function

Callback fired when the Menu has exited.

onExiting
function

Callback fired when the Menu is exiting.

open
(required)
bool

If true, the menu is visible.

PaperProps
object
PopoverClasses
object

classes prop applied to the Popover element.

transitionDuration
'auto' | number | {"appear":"number","enter":"number","exit":"number"}

The length of the transition in ms, or ‘auto’

variant
'menu' | 'selectedMenu'

The variant to use. Use menu to prevent selected items from impacting the initial focus and the vertical alignment relative to the anchor element.

Help and resources