@mui/material#Slide JavaScript Examples

The following examples show how to use @mui/material#Slide. 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 vote down vote up
// ----------------------------------------------------------------------

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>
  );
}
Example #2
Source File: DirectionSnackbar.jsx    From matx-react with MIT License 5 votes vote down vote up
function TransitionLeft(props) {
  return <Slide {...props} direction="left" />;
}
Example #3
Source File: DirectionSnackbar.jsx    From matx-react with MIT License 5 votes vote down vote up
function TransitionUp(props) {
  return <Slide {...props} direction="up" />;
}
Example #4
Source File: DirectionSnackbar.jsx    From matx-react with MIT License 5 votes vote down vote up
function TransitionRight(props) {
  return <Slide {...props} direction="right" />;
}
Example #5
Source File: DirectionSnackbar.jsx    From matx-react with MIT License 5 votes vote down vote up
function TransitionDown(props) {
  return <Slide {...props} direction="down" />;
}
Example #6
Source File: TransitionSnackbar.jsx    From matx-react with MIT License 5 votes vote down vote up
function SlideTransition(props) {
  return <Slide {...props} direction="up" />;
}