mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-05 09:49:57 +08:00
326758097a
* 🔀 feat: rebase feature * ✨ feat: update * ✨ feat: update * ✨ feat: update snap * ✨ feat: update * ✨ feat: update * ✨ feat: update * ✨ feat: update * ✨ feat: add groupSpace * ✨ feat: update * ✨ feat: update * ✨ feat: update * ✨ feat: update * ✨ feat: update * ✨ feat: update demo * Update components/avatar/demo/component-token.tsx --------- Co-authored-by: MadCcc <1075746765@qq.com>
52 lines
1.4 KiB
TypeScript
52 lines
1.4 KiB
TypeScript
import { AntDesignOutlined, UserOutlined } from '@ant-design/icons';
|
|
import { Avatar, Badge, ConfigProvider, Space, Tooltip } from 'antd';
|
|
import React from 'react';
|
|
|
|
const App: React.FC = () => (
|
|
<ConfigProvider
|
|
theme={{
|
|
components: {
|
|
Avatar: {
|
|
containerSize: 60,
|
|
containerSizeLG: 30,
|
|
containerSizeSM: 16,
|
|
|
|
textFontSize: 18,
|
|
textFontSizeLG: 28,
|
|
textFontSizeSM: 12,
|
|
|
|
borderRadius: 10,
|
|
groupOverlapping: -10,
|
|
groupBorderColor: '#eee',
|
|
},
|
|
},
|
|
}}
|
|
>
|
|
<Space>
|
|
<Avatar shape="circle" src="http://abc.com/not-exist.jpg">
|
|
A
|
|
</Avatar>
|
|
</Space>
|
|
<Space>
|
|
<Avatar.Group maxCount={2} maxStyle={{ color: '#f56a00', backgroundColor: '#fde3cf' }}>
|
|
<Avatar src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=2" />
|
|
<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>
|
|
</Space>
|
|
<Space>
|
|
<Badge count={1}>
|
|
<Avatar shape="square" icon={<UserOutlined />} />
|
|
</Badge>
|
|
<Badge dot>
|
|
<Avatar shape="square" icon={<UserOutlined />} />
|
|
</Badge>
|
|
</Space>
|
|
</ConfigProvider>
|
|
);
|
|
|
|
export default App;
|