forked from mui/material-ui
-
Notifications
You must be signed in to change notification settings - Fork 1
/
AlertColors.tsx
67 lines (66 loc) · 1.91 KB
/
AlertColors.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import * as React from 'react';
import Alert from '@mui/joy/Alert';
import Stack from '@mui/joy/Stack';
import Box from '@mui/joy/Box';
import Radio from '@mui/joy/Radio';
import RadioGroup from '@mui/joy/RadioGroup';
import Sheet from '@mui/joy/Sheet';
import { VariantProp } from '@mui/joy/styles';
import Typography from '@mui/joy/Typography';
export default function AlertColors() {
const [variant, setVariant] = React.useState<VariantProp>('solid');
return (
<Box
sx={{
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
width: '100%',
}}
>
<Stack spacing={1} sx={{ width: '100%', maxWidth: 400 }}>
<Alert variant={variant} color="primary">
Primary
</Alert>
<Alert variant={variant} color="neutral">
Neutral
</Alert>
<Alert variant={variant} color="danger">
Danger
</Alert>
<Alert variant={variant} color="info">
Info
</Alert>
<Alert variant={variant} color="success">
Success
</Alert>
<Alert variant={variant} color="warning">
Warning
</Alert>
</Stack>
<Sheet sx={{ pl: 4, ml: 3, borderLeft: '1px solid', borderColor: 'divider' }}>
<Typography
level="body2"
fontWeight="xl"
id="variant-label"
textColor="text.primary"
mb={1}
>
Variant:
</Typography>
<RadioGroup
size="sm"
aria-labelledby="variant-label"
name="variant"
value={variant}
onChange={(event) => setVariant(event.target.value as VariantProp)}
>
<Radio label="Solid" value="solid" />
<Radio label="Soft" value="soft" />
<Radio label="Outlined" value="outlined" />
<Radio label="Plain" value="plain" />
</RadioGroup>
</Sheet>
</Box>
);
}