2020-07-13 12:45:37 +08:00
|
|
|
---
|
|
|
|
order: 4
|
|
|
|
title:
|
|
|
|
zh-CN: Avatar.Group
|
|
|
|
en-US: Avatar.Group
|
|
|
|
---
|
|
|
|
|
|
|
|
## zh-CN
|
|
|
|
|
|
|
|
头像组合展现。
|
|
|
|
|
|
|
|
## en-US
|
|
|
|
|
|
|
|
Avatar group display.
|
|
|
|
|
|
|
|
```tsx
|
|
|
|
import { Avatar, Divider, Tooltip } from 'antd';
|
|
|
|
import { UserOutlined, AntDesignOutlined } from '@ant-design/icons';
|
|
|
|
|
2021-02-23 10:45:11 +08:00
|
|
|
const Demo = () => (
|
|
|
|
<>
|
|
|
|
<Avatar.Group>
|
2021-10-14 12:09:07 +08:00
|
|
|
<Avatar src="https://joeschmoe.io/api/v1/random" />
|
2021-02-23 10:45:11 +08:00
|
|
|
<Avatar style={{ backgroundColor: '#f56a00' }}>K</Avatar>
|
|
|
|
<Tooltip title="Ant User" placement="top">
|
|
|
|
<Avatar style={{ backgroundColor: '#87d068' }} icon={<UserOutlined />} />
|
|
|
|
</Tooltip>
|
|
|
|
<Avatar style={{ backgroundColor: '#1890ff' }} icon={<AntDesignOutlined />} />
|
|
|
|
</Avatar.Group>
|
|
|
|
<Divider />
|
|
|
|
<Avatar.Group maxCount={2} maxStyle={{ color: '#f56a00', backgroundColor: '#fde3cf' }}>
|
2021-10-14 12:09:07 +08:00
|
|
|
<Avatar src="https://joeschmoe.io/api/v1/random" />
|
2021-02-23 10:45:11 +08:00
|
|
|
<Avatar style={{ backgroundColor: '#f56a00' }}>K</Avatar>
|
|
|
|
<Tooltip title="Ant User" placement="top">
|
|
|
|
<Avatar style={{ backgroundColor: '#87d068' }} icon={<UserOutlined />} />
|
|
|
|
</Tooltip>
|
|
|
|
<Avatar style={{ backgroundColor: '#1890ff' }} icon={<AntDesignOutlined />} />
|
|
|
|
</Avatar.Group>
|
|
|
|
<Divider />
|
|
|
|
<Avatar.Group
|
|
|
|
maxCount={2}
|
|
|
|
size="large"
|
|
|
|
maxStyle={{ color: '#f56a00', backgroundColor: '#fde3cf' }}
|
|
|
|
>
|
2021-10-14 12:09:07 +08:00
|
|
|
<Avatar src="https://joeschmoe.io/api/v1/random" />
|
2021-02-23 10:45:11 +08:00
|
|
|
<Avatar style={{ backgroundColor: '#f56a00' }}>K</Avatar>
|
|
|
|
<Tooltip title="Ant User" placement="top">
|
|
|
|
<Avatar style={{ backgroundColor: '#87d068' }} icon={<UserOutlined />} />
|
|
|
|
</Tooltip>
|
|
|
|
<Avatar style={{ backgroundColor: '#1890ff' }} icon={<AntDesignOutlined />} />
|
|
|
|
</Avatar.Group>
|
2021-09-17 09:52:51 +08:00
|
|
|
<Divider />
|
|
|
|
<Avatar.Group
|
|
|
|
maxCount={2}
|
|
|
|
maxPopoverTrigger="click"
|
|
|
|
size="large"
|
|
|
|
maxStyle={{ color: '#f56a00', backgroundColor: '#fde3cf', cursor: 'pointer' }}
|
|
|
|
>
|
|
|
|
<Avatar src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png" />
|
|
|
|
<Avatar style={{ backgroundColor: '#f56a00' }}>K</Avatar>
|
|
|
|
<Tooltip title="Ant User" placement="top">
|
|
|
|
<Avatar style={{ backgroundColor: '#87d068' }} icon={<UserOutlined />} />
|
|
|
|
</Tooltip>
|
|
|
|
<Avatar style={{ backgroundColor: '#1890ff' }} icon={<AntDesignOutlined />} />
|
|
|
|
</Avatar.Group>
|
2021-02-23 10:45:11 +08:00
|
|
|
</>
|
|
|
|
);
|
2020-07-13 12:45:37 +08:00
|
|
|
|
|
|
|
ReactDOM.render(<Demo />, mountNode);
|
|
|
|
```
|