mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-23 23:18:36 +08:00
6b1d73bdd9
* feat: Avatar.Group add size props * change type
61 lines
2.0 KiB
Markdown
61 lines
2.0 KiB
Markdown
---
|
|
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';
|
|
|
|
class Demo extends React.Component {
|
|
render() {
|
|
return (
|
|
<>
|
|
<Avatar.Group>
|
|
<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>
|
|
<Divider />
|
|
<Avatar.Group maxCount={2} maxStyle={{ color: '#f56a00', backgroundColor: '#fde3cf' }}>
|
|
<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>
|
|
<Divider />
|
|
<Avatar.Group
|
|
maxCount={2}
|
|
size="large"
|
|
maxStyle={{ color: '#f56a00', backgroundColor: '#fde3cf' }}
|
|
>
|
|
<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>
|
|
</>
|
|
);
|
|
}
|
|
}
|
|
|
|
ReactDOM.render(<Demo />, mountNode);
|
|
```
|