@mui/material APIs
- Button
- IconButton
- TextField
- Typography
- Box
- Toolbar
- ListItemText
- AppBar
- ListItem
- MenuItem
- List
- Grid
- CssBaseline
- Drawer
- Tooltip
- Menu
- Checkbox
- Paper
- Card
- CardContent
- ListItemIcon
- CircularProgress
- Select
- FormControl
- TablePagination
- Table
- TableHead
- TableRow
- TableCell
- TableBody
- Divider
- FormControlLabel
- Stack
- Switch
- Autocomplete
- Collapse
- Dialog
- InputAdornment
- Avatar
- Chip
- DialogTitle
- TableSortLabel
- Link
- Alert
- createTheme
- Input
- CardActions
- ListItemButton
- styled
- useMediaQuery
- DialogActions
- DialogContent
- InputLabel
- Container
- Breadcrumbs
- TableContainer
- ThemeProvider
- OutlinedInput
- Hidden
- Snackbar
- CardActionArea
- Icon
- ListItemSecondaryAction
- Accordion
- AccordionSummary
- AccordionDetails
- Popover
- FormHelperText
- SvgIcon
- Portal
- Slide
- FormLabel
- RadioGroup
- Radio
- Tabs
- Tab
- Slider
- LinearProgress
- Fade
- Grow
- Modal
- FormGroup
- CardMedia
- PaginationItem
- colors
- CardHeader
- StyledEngineProvider
- ListItemAvatar
- adaptV4Theme
- DialogContentText
- Backdrop
- ImageListItemBar
- MenuList
- GlobalStyles
- ClickAwayListener
- AlertTitle
- debounce
- NativeSelect
- InputBase
- ToggleButton
- ToggleButtonGroup
- createMuiTheme
- useTheme
- Badge
- ButtonBase
- Fab
- lighten
- SnackbarContent
OtherRelated APIs
@mui/material#ClickAwayListener JavaScript Examples
The following examples show how to use
@mui/material#ClickAwayListener.
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: Searchbar.js From Django-REST-Framework-React-BoilerPlate with MIT License | 5 votes |
![]() ![]() |
// ----------------------------------------------------------------------
export default function Searchbar() {
const [isOpen, setOpen] = useState(false);
const handleOpen = () => {
setOpen((prev) => !prev);
};
const handleClose = () => {
setOpen(false);
};
return (
<ClickAwayListener onClickAway={handleClose}>
<div>
{!isOpen && (
<IconButton onClick={handleOpen}>
<Iconify icon="eva:search-fill" width={20} height={20} />
</IconButton>
)}
<Slide direction="down" in={isOpen} mountOnEnter unmountOnExit>
<SearchbarStyle>
<Input
autoFocus
fullWidth
disableUnderline
placeholder="Search…"
startAdornment={
<InputAdornment position="start">
<Iconify icon="eva:search-fill" sx={{ color: 'text.disabled', width: 20, height: 20 }} />
</InputAdornment>
}
sx={{ mr: 1, fontWeight: 'fontWeightBold' }}
/>
<Button variant="contained" onClick={handleClose}>
Search
</Button>
</SearchbarStyle>
</Slide>
</div>
</ClickAwayListener>
);
}