mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-15 08:59:15 +08:00
34a277cdaa
* docs: delete redundant codes repetitive examples that can make it difficult for developers to read * chore: update snapshot * docs(badge): wrapping documents with `Space` * chore: update snapshot * chore(space): optimize documents easy to read * chore: update badge demo * chore: update demo * Revert "chore(space): optimize documents" This reverts commit 88a4378f16cede5b628f885a48a341d507fd53e3. * chore: update snapshots * chore(button): add debug demo * test(button): update snapshots * docs(button): example document beautify * test(button): update snapshots commit by af04705c8f * test(alert): update snapshots * chore: Reverse format
49 lines
1.6 KiB
TypeScript
49 lines
1.6 KiB
TypeScript
import React, { useState } from 'react';
|
|
import { DownloadOutlined } from '@ant-design/icons';
|
|
import { Button, Radio, Space, Divider } from 'antd';
|
|
import type { SizeType } from 'antd/es/config-provider/SizeContext';
|
|
|
|
const App: React.FC = () => {
|
|
const [size, setSize] = useState<SizeType>('large'); // default is 'middle'
|
|
|
|
return (
|
|
<>
|
|
<Radio.Group value={size} onChange={(e) => setSize(e.target.value)}>
|
|
<Radio.Button value="large">Large</Radio.Button>
|
|
<Radio.Button value="default">Default</Radio.Button>
|
|
<Radio.Button value="small">Small</Radio.Button>
|
|
</Radio.Group>
|
|
<Divider orientation="left" plain>
|
|
Preview
|
|
</Divider>
|
|
<Space direction="vertical">
|
|
<Space wrap>
|
|
<Button type="primary" size={size}>
|
|
Primary
|
|
</Button>
|
|
<Button size={size}>Default</Button>
|
|
<Button type="dashed" size={size}>
|
|
Dashed
|
|
</Button>
|
|
</Space>
|
|
<Button type="link" size={size}>
|
|
Link
|
|
</Button>
|
|
<Space wrap>
|
|
<Button type="primary" icon={<DownloadOutlined />} size={size} />
|
|
<Button type="primary" shape="circle" icon={<DownloadOutlined />} size={size} />
|
|
<Button type="primary" shape="round" icon={<DownloadOutlined />} size={size} />
|
|
<Button type="primary" shape="round" icon={<DownloadOutlined />} size={size}>
|
|
Download
|
|
</Button>
|
|
<Button type="primary" icon={<DownloadOutlined />} size={size}>
|
|
Download
|
|
</Button>
|
|
</Space>
|
|
</Space>
|
|
</>
|
|
);
|
|
};
|
|
|
|
export default App;
|