mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 20:19:44 +08:00
8cd63a4d89
* test(badge): add case * fix(badge): fix `Badge` and `showZero` can't be used with custom color issue: https://github.com/ant-design/ant-design/issues/38965 * test: update snapshots * docs(badge): update demos * test: update snapshot
48 lines
1.3 KiB
TypeScript
48 lines
1.3 KiB
TypeScript
import React from 'react';
|
|
import { Avatar, Badge, Space } from 'antd';
|
|
|
|
const App: React.FC = () => (
|
|
<Space size="middle" wrap>
|
|
<Space size="middle" wrap>
|
|
<Badge count={5} status="success">
|
|
<Avatar shape="square" size="large" />
|
|
</Badge>
|
|
<Badge count={5} status="warning">
|
|
<Avatar shape="square" size="large" />
|
|
</Badge>
|
|
<Badge count={5} color="blue">
|
|
<Avatar shape="square" size="large" />
|
|
</Badge>
|
|
<Badge count={5} color="#fa541c">
|
|
<Avatar shape="square" size="large" />
|
|
</Badge>
|
|
<Badge dot status="success">
|
|
<Avatar shape="square" size="large" />
|
|
</Badge>
|
|
<Badge dot status="warning">
|
|
<Avatar shape="square" size="large" />
|
|
</Badge>
|
|
<Badge dot color="blue">
|
|
<Avatar shape="square" size="large" />
|
|
</Badge>
|
|
<Badge dot color="#fa541c">
|
|
<Avatar shape="square" size="large" />
|
|
</Badge>
|
|
</Space>
|
|
|
|
<Space size="middle" wrap>
|
|
<Badge count={0} showZero />
|
|
<Badge count={0} showZero color='blue' />
|
|
<Badge count={0} showZero color='#f0f' />
|
|
<Badge count={0} showZero>
|
|
<Avatar shape="square" size="large" />
|
|
</Badge>
|
|
<Badge count={0} showZero color='blue'>
|
|
<Avatar shape="square" size="large" />
|
|
</Badge>
|
|
</Space>
|
|
</Space>
|
|
);
|
|
|
|
export default App;
|