MenuItem API
Demos
For examples and details on the usage of this React component, visit the component demo pages:
Import
import MenuItem from '@mui/joy/MenuItem';
// or
import { MenuItem } from '@mui/joy';
Props
Name | Type | Default | Description |
---|---|---|---|
children | node | The content of the component. | |
color | 'danger' | 'info' | 'neutral' | 'primary' | 'success' | 'warning' | string | selected ? 'primary' : 'neutral' | The color of the component. It supports those theme colors that make sense for this component. To learn how to add your own colors, check out Themed components—Extend colors. |
selected | bool | false | If true , the component is selected. |
variant | 'contained' | 'light' | 'outlined' | 'text' | string | 'plain' | The global variant to use. To learn how to add your own variants, check out Themed components—Extend variants. |
The
ref
is forwarded to the root element.Inheritance
While not explicitly documented above, the props of the ListItemButton component are also available on MenuItem. You can take advantage of this to target nested components.Theme default props
You can useJoyMenuItem
to change the default props of this component with the theme.