import * as React from 'react';
import Grid from '@mui/joy/Grid';
import Box from '@mui/joy/Box';
import Button from '@mui/joy/Button';
import Snackbar from '@mui/joy/Snackbar';
import NorthWestIcon from '@mui/icons-material/NorthWest';
import NorthEastIcon from '@mui/icons-material/NorthEast';
import NorthIcon from '@mui/icons-material/North';
import SouthIcon from '@mui/icons-material/South';
import SouthEastIcon from '@mui/icons-material/SouthEast';
import SouthWestIcon from '@mui/icons-material/SouthWest';
export default function PositionedSnackbar() {
const [state, setState] = React.useState({
open: false,
vertical: 'top',
horizontal: 'center',
});
const { vertical, horizontal, open } = state;
const handleClick = (newState) => () => {
setState({ ...newState, open: true });
};
const handleClose = () => {
setState({ ...state, open: false });
};
const buttons = (
}
onClick={handleClick({ vertical: 'top', horizontal: 'center' })}
sx={{ flexDirection: 'column', gap: 1, '--Button-gap': 0 }}
>
Top Center
}
onClick={handleClick({ vertical: 'top', horizontal: 'left' })}
>
Top Left
}
onClick={handleClick({ vertical: 'top', horizontal: 'right' })}
>
Top Right
}
onClick={handleClick({ vertical: 'bottom', horizontal: 'left' })}
>
Bottom Left
}
onClick={handleClick({ vertical: 'bottom', horizontal: 'right' })}
>
Bottom Right
}
onClick={handleClick({ vertical: 'bottom', horizontal: 'center' })}
sx={{ flexDirection: 'column', gap: 1, '--Button-gap': 0 }}
>
Bottom Center
);
return (
{buttons}
I love snacks
);
}