@mui/material APIs
- Button
- IconButton
- Typography
- MenuItem
- Box
- Tooltip
- TextField
- CircularProgress
- FormControlLabel
- List
- Divider
- ListItem
- ListItemText
- Select
- Grid
- ThemeProvider
- FormControl
- Link
- useTheme
- InputLabel
- Paper
- Dialog
- DialogTitle
- Toolbar
- createTheme
- LinearProgress
- Container
- Checkbox
- ListItemIcon
- DialogContent
- Card
- CssBaseline
- Theme
- useMediaQuery
- Menu
- Alert
- Tab
- DialogActions
- AppBar
- Switch
- Drawer
- Chip
- InputAdornment
- Collapse
- Stack
- CardContent
- DialogContentText
- TableBody
- TableCell
- TableRow
- Skeleton
- Table
- Tabs
- Avatar
- Autocomplete
- FormGroup
- SelectChangeEvent
- Radio
- AlertTitle
- TableHead
- InputBase
- Input
- Snackbar
- TextFieldProps
- styled
- alpha
- TableContainer
- CardActions
- Badge
- CardHeader
- ListItemButton
- CardActionArea
- Modal
- AccordionDetails
- AccordionSummary
- ButtonProps
- StyledEngineProvider
- RadioGroup
- ListItemAvatar
- Fade
- CardMedia
- Accordion
- Slider
- FormLabel
- FormHelperText
- Popover
- Backdrop
- Popper
- ThemeOptions
- Zoom
- ToggleButton
- ToggleButtonGroup
- SxProps
- Fab
- TooltipProps
- IconButtonProps
- CircularProgressProps
- darken
- TextareaAutosize
- OutlinedInput
- Breadcrumbs
- Slide
- SwipeableDrawer
- ClickAwayListener
- SelectProps
- TypographyProps
- ButtonBase
- ListItemSecondaryAction
- SvgIcon
- Pagination
- tooltipClasses
- ButtonGroup
- Hidden
- debounce
- FilledInput
- lighten
- useScrollTrigger
- darkScrollbar
- PaletteMode
- SnackbarCloseReason
- MenuList
- SvgIconProps
- SnackbarProps
- AlertColor
- Icon
- TablePagination
- MenuItemProps
- Stepper
- Step
- StepLabel
- ownerWindow
- useForkRef
- AlertProps
- InputUnstyled
- Rating
- capitalize
- SpeedDial
- SpeedDialAction
- SpeedDialIcon
- BadgeProps
- createSvgIcon
- Grow
- linearProgressClasses
- PaletteColor
- BottomNavigation
- Palette
- responsiveFontSizes
- OutlinedInputProps
- TabProps
- NoSsr
- PaletteOptions
- ListSubheader
- ImageList
- StepConnector
- tableCellClasses
- TableSortLabel
Other Related APIs
- react#useState
- react#useCallback
- @mui/material#Box
- @mui/material#Button
- @mui/material#IconButton
- @mui/material#Tooltip
- @mui/material#Typography
- @mui/material#Divider
- @mui/material#ListItemIcon
- @mui/material#ListItemText
- @mui/material#Menu
- @mui/material#MenuItem
- @mui/material#Popover
- @mui/material#Stack
- @mui/icons-material#MoreVert
- @mui/icons-material#Settings
- @mui/icons-material#Help
- @mui/icons-material#PauseCircle
- @mui/icons-material#PhotoCamera
- @mui/icons-material#PlayCircle
- @mui/icons-material#VolumeOff
@mui/material#MenuList TypeScript Examples
The following examples show how to use
@mui/material#MenuList.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: OptimizationTargetSelector.tsx From genshin-optimizer with MIT License | 6 votes |
function SelectorSection({ displayNs, sectionKey, setTarget }: { displayNs: DisplaySub<NodeDisplay>, sectionKey: string, setTarget: (target: string[]) => void }) {
const { data } = useContext(DataContext)
const header = usePromise(getDisplayHeader(data, sectionKey), [data, sectionKey])
return <CardLight key={sectionKey as string}>
{header && <CardHeader avatar={header.icon && <ImgIcon size={2} sx={{ m: -1 }} src={header.icon} />} title={header.title} action={header.action} titleTypographyProps={{ variant: "subtitle1" }} />}
<Divider />
<MenuList>
{Object.entries(displayNs).map(([key, n]) =>
<TargetSelectorMenuItem key={key} node={n} onClick={() => setTarget([sectionKey, key])} />)}
</MenuList>
</CardLight>
}
Example #2
Source File: PlayBar.tsx From rewind with MIT License | 5 votes |
function BaseSpeedButton(props: BaseSpeedButtonProps) {
const { value, onChange } = props;
const [anchorEl, setAnchorEl] = useState(null);
const open = Boolean(anchorEl);
const handleClick = (event: any) => {
setAnchorEl(event.currentTarget);
};
const handleClose = () => {
setAnchorEl(null);
};
const formatSpeed = (s: number) => `${s}x`;
// Floating point issues?
return (
<>
<Button
sx={{
color: "text.primary",
textTransform: "none",
fontSize: "1em",
// minWidth: "0",
// px: 2,
}}
size={"small"}
onClick={handleClick}
onFocus={ignoreFocus}
>
{formatSpeed(value)}
{/*<Typography>{formatSpeed(value)}</Typography>*/}
</Button>
<Menu
open={open}
onClose={handleClose}
anchorEl={anchorEl}
anchorOrigin={{
vertical: "top",
horizontal: "center",
}}
transformOrigin={{
vertical: "bottom",
horizontal: "center",
}}
>
<MenuList>
{ALLOWED_SPEEDS.map((s) => (
<MenuItem
key={s}
onClick={() => {
onChange(s);
handleClose();
}}
sx={{ width: "120px", maxWidth: "100%" }}
>
<ListItemText>{formatSpeed(s)}</ListItemText>
<Typography variant="body2" color="text.secondary">
{speedLabels[s] ?? ""}
</Typography>
</MenuItem>
))}
</MenuList>
</Menu>
</>
);
}