mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-02 15:59:38 +08:00
0f9da43522
* add avatar support custom size * me added to author list and sorting alphabetically * fix avatar sizeChildrenStyle preference * fix authors * fix snapshots
43 lines
772 B
Markdown
43 lines
772 B
Markdown
---
|
|
order: 0
|
|
title:
|
|
zh-CN: 基本
|
|
en-US: Basic
|
|
---
|
|
|
|
## zh-CN
|
|
|
|
头像有三种尺寸,两种形状可选。
|
|
|
|
## en-US
|
|
|
|
Three sizes and two shapes are available.
|
|
|
|
````jsx
|
|
import { Avatar } from 'antd';
|
|
|
|
ReactDOM.render(
|
|
<div>
|
|
<div>
|
|
<Avatar size={64} icon="user" />
|
|
<Avatar size="large" icon="user" />
|
|
<Avatar icon="user" />
|
|
<Avatar size="small" icon="user" />
|
|
</div>
|
|
<div>
|
|
<Avatar shape="square" size={64} icon="user" />
|
|
<Avatar shape="square" size="large" icon="user" />
|
|
<Avatar shape="square" icon="user" />
|
|
<Avatar shape="square" size="small" icon="user" />
|
|
</div>
|
|
</div>,
|
|
mountNode);
|
|
````
|
|
|
|
<style>
|
|
#components-avatar-demo-basic .ant-avatar {
|
|
margin-top: 16px;
|
|
margin-right: 16px;
|
|
}
|
|
</style>
|