25 lines
775 B
TypeScript
25 lines
775 B
TypeScript
|
|
import Alert from '@mui/material/Alert';
|
||
|
|
import CheckIcon from '@mui/icons-material/Check';
|
||
|
|
import CheckCircleOutlineIcon from '@mui/icons-material/CheckCircleOutline';
|
||
|
|
import Stack from '@mui/material/Stack';
|
||
|
|
|
||
|
|
export default function IconAlerts() {
|
||
|
|
return (
|
||
|
|
<Stack sx={{ width: '100%' }} spacing={2}>
|
||
|
|
<Alert icon={<CheckIcon fontSize="inherit" />} severity="success">
|
||
|
|
This success Alert has a custom icon.
|
||
|
|
</Alert>
|
||
|
|
<Alert icon={false} severity="success">
|
||
|
|
This success Alert has no icon.
|
||
|
|
</Alert>
|
||
|
|
<Alert
|
||
|
|
iconMapping={{
|
||
|
|
success: <CheckCircleOutlineIcon fontSize="inherit" />,
|
||
|
|
}}
|
||
|
|
>
|
||
|
|
This success Alert uses `iconMapping` to override the default icon.
|
||
|
|
</Alert>
|
||
|
|
</Stack>
|
||
|
|
);
|
||
|
|
}
|