mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-25 00:08:27 +08:00
63 lines
1.3 KiB
TypeScript
63 lines
1.3 KiB
TypeScript
import React, { useState } from 'react';
|
|
import type { StepsProps } from 'antd';
|
|
import { Card, Radio, Steps } from 'antd';
|
|
|
|
const App: React.FC = () => {
|
|
const [size, setSize] = useState<StepsProps['size']>('default');
|
|
const description = 'This is a description.';
|
|
const horizontalSteps = (
|
|
<Card>
|
|
<Steps
|
|
size={size}
|
|
items={[
|
|
{
|
|
title: 'Finished',
|
|
description,
|
|
},
|
|
{
|
|
title: 'In Progress',
|
|
description,
|
|
},
|
|
{
|
|
title: 'Waiting',
|
|
description,
|
|
},
|
|
]}
|
|
/>
|
|
</Card>
|
|
);
|
|
|
|
return (
|
|
<>
|
|
<Radio.Group
|
|
style={{ marginBottom: 16 }}
|
|
value={size}
|
|
onChange={(e) => setSize(e.target.value)}
|
|
>
|
|
<Radio value="small">Small</Radio>
|
|
<Radio value="default">Default</Radio>
|
|
</Radio.Group>
|
|
<Steps
|
|
size={size}
|
|
direction="vertical"
|
|
items={[
|
|
{
|
|
title: 'Finished',
|
|
description: horizontalSteps,
|
|
},
|
|
{
|
|
title: 'In Progress',
|
|
description,
|
|
},
|
|
{
|
|
title: 'Waiting',
|
|
description,
|
|
},
|
|
]}
|
|
/>
|
|
</>
|
|
);
|
|
};
|
|
|
|
export default App;
|