mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-05 09:49:57 +08:00
b9a6b7b578
* demo: update demo * add form * clear * add Select * add * fix style * fix style * fix * revert
82 lines
1.8 KiB
TypeScript
82 lines
1.8 KiB
TypeScript
import React from 'react';
|
|
import { Avatar, Segmented, Space } from 'antd';
|
|
import { UserOutlined } from '@ant-design/icons';
|
|
|
|
const App: React.FC = () => (
|
|
<Space direction="vertical">
|
|
<Segmented
|
|
options={[
|
|
{
|
|
label: (
|
|
<div style={{ padding: 4 }}>
|
|
<Avatar src="https://joeschmoe.io/api/v1/random" />
|
|
<div>User 1</div>
|
|
</div>
|
|
),
|
|
value: 'user1',
|
|
},
|
|
{
|
|
label: (
|
|
<div style={{ padding: 4 }}>
|
|
<Avatar style={{ backgroundColor: '#f56a00' }}>K</Avatar>
|
|
<div>User 2</div>
|
|
</div>
|
|
),
|
|
value: 'user2',
|
|
},
|
|
{
|
|
label: (
|
|
<div style={{ padding: 4 }}>
|
|
<Avatar style={{ backgroundColor: '#87d068' }} icon={<UserOutlined />} />
|
|
<div>User 3</div>
|
|
</div>
|
|
),
|
|
value: 'user3',
|
|
},
|
|
]}
|
|
/>
|
|
<Segmented
|
|
options={[
|
|
{
|
|
label: (
|
|
<div style={{ padding: 4 }}>
|
|
<div>Spring</div>
|
|
<div>Jan-Mar</div>
|
|
</div>
|
|
),
|
|
value: 'spring',
|
|
},
|
|
{
|
|
label: (
|
|
<div style={{ padding: 4 }}>
|
|
<div>Summer</div>
|
|
<div>Apr-Jun</div>
|
|
</div>
|
|
),
|
|
value: 'summer',
|
|
},
|
|
{
|
|
label: (
|
|
<div style={{ padding: 4 }}>
|
|
<div>Autumn</div>
|
|
<div>Jul-Sept</div>
|
|
</div>
|
|
),
|
|
value: 'autumn',
|
|
},
|
|
{
|
|
label: (
|
|
<div style={{ padding: 4 }}>
|
|
<div>Winter</div>
|
|
<div>Oct-Dec</div>
|
|
</div>
|
|
),
|
|
value: 'winter',
|
|
},
|
|
]}
|
|
/>
|
|
</Space>
|
|
);
|
|
|
|
export default App;
|