Menu
The Dropdown Menu components provide end users with a list of options on temporary surfaces.
useDropdown API
Import
import { useDropdown } from '@mui/base/useDropdown';
// or
import { useDropdown } from '@mui/base';
Parameters
Callback fired when the component requests to be opened or closed.
Type:
(event: React.MouseEvent | React.KeyboardEvent | React.FocusEvent | null, open: boolean) => void
Return value
useMenu API
Import
import { useMenu } from '@mui/base/useMenu';
// or
import { useMenu } from '@mui/base';
Parameters
Return value
Action dispatcher for the menu component. Allows to programmatically control the menu.
Type:
(action: ListAction<string>) => void
Resolver for the listbox slot's props.
Type:
<ExternalProps extends Record<string, unknown> = {}>(externalProps?: ExternalProps) => UseMenuListboxSlotProps
Items in the menu listbox.
Type:
Map<string, MenuItemMetadata>
useMenuButton API
Import
import { useMenuButton } from '@mui/base/useMenuButton';
// or
import { useMenuButton } from '@mui/base';
Parameters
Return value
Resolver for the root slot's props.
Type:
<ExternalProps extends Record<string, unknown> = {}>(externalProps?: ExternalProps) => UseMenuButtonRootSlotProps<ExternalProps>
useMenuItem API
Import
import { useMenuItem } from '@mui/base/useMenuItem';
// or
import { useMenuItem } from '@mui/base';
Parameters
Return value
Resolver for the root slot's props.
Type:
<ExternalProps extends Record<string, unknown> = {}>(externalProps?: ExternalProps) => UseMenuItemRootSlotProps<ExternalProps>