ant-design/components/steps/demo/clickable.tsx
linercoder 1fdd45ef10
doc: replace the printed value (#40847)
Co-authored-by: linercoder <linjunjie@realibox.com>
2023-02-21 17:59:18 +08:00

60 lines
1.1 KiB
TypeScript

import React, { useState } from 'react';
import { Divider, Steps } from 'antd';
const App: React.FC = () => {
const [current, setCurrent] = useState(0);
const onChange = (value: number) => {
console.log('onChange:', value);
setCurrent(value);
};
const description = 'This is a description.';
return (
<>
<Steps
current={current}
onChange={onChange}
items={[
{
title: 'Step 1',
description,
},
{
title: 'Step 2',
description,
},
{
title: 'Step 3',
description,
},
]}
/>
<Divider />
<Steps
current={current}
onChange={onChange}
direction="vertical"
items={[
{
title: 'Step 1',
description,
},
{
title: 'Step 2',
description,
},
{
title: 'Step 3',
description,
},
]}
/>
</>
);
};
export default App;