forked from mui/material-ui
-
Notifications
You must be signed in to change notification settings - Fork 1
/
DividedList.js
55 lines (54 loc) · 1.7 KB
/
DividedList.js
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
import * as React from 'react';
import Avatar from '@mui/joy/Avatar';
import Box from '@mui/joy/Box';
import List from '@mui/joy/List';
import ListDivider from '@mui/joy/ListDivider';
import ListItem from '@mui/joy/ListItem';
import ListItemDecorator from '@mui/joy/ListItemDecorator';
import Typography from '@mui/joy/Typography';
export default function DividedList() {
return (
<Box
sx={{
display: 'flex',
flexWrap: 'wrap',
justifyContent: 'center',
gap: 4,
}}
>
{[undefined, 'gutter', 'startDecorator', 'startContent'].map((inset) => (
<Box key={inset || 'default'}>
<Typography level="body3" mb={2}>
<code>{inset ? `inset="${inset}"` : '(default)'}</code>
</Typography>
<List
variant="outlined"
sx={{
bgcolor: 'background.body',
minWidth: 240,
borderRadius: 'sm',
boxShadow: 'sm',
'--List-decorator-size': '48px',
'--List-item-paddingLeft': '1.5rem',
'--List-item-paddingRight': '1rem',
}}
>
<ListItem>
<ListItemDecorator sx={{ alignSelf: 'flex-start' }}>
<Avatar size="sm" src="/static/images/avatar/1.jpg" />
</ListItemDecorator>
Mabel Boyle
</ListItem>
<ListDivider inset={inset} />
<ListItem>
<ListItemDecorator sx={{ alignSelf: 'flex-start' }}>
<Avatar size="sm" src="/static/images/avatar/2.jpg" />
</ListItemDecorator>
Boyd Burt
</ListItem>
</List>
</Box>
))}
</Box>
);
}