ant-design/components/avatar/demo/badge.md
偏右 a5efa7a81a
test: increase coverage of Progress/Comment/Avatar/Dropdown (#24439)
* test: increase test case of Progress and Comment

* test: add test case for Avatar

* test: add test case for Dropdown

* fix snapshot

* fix snapshot

* remove console.log

* fix lint

* add avatar
2020-05-25 16:27:02 +08:00

48 lines
730 B
Markdown

---
order: 3
title:
zh-CN: 带徽标的头像
en-US: With Badge
---
## zh-CN
通常用于消息提示。
## en-US
Usually used for reminders and notifications.
```tsx
import { Avatar, Badge } from 'antd';
import { UserOutlined } from '@ant-design/icons';
ReactDOM.render(
<>
<span className="avatar-item">
<Badge count={1}>
<Avatar shape="square" icon={<UserOutlined />} />
</Badge>
</span>
<span>
<Badge dot>
<Avatar shape="square" icon={<UserOutlined />} />
</Badge>
</span>
</>,
mountNode,
);
```
```css
/* tile uploaded pictures */
.avatar-item {
margin-right: 24px;
}
[class*='-col-rtl'] .avatar-item {
margin-right: 0;
margin-left: 24px;
}
```