mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-06 05:58:46 +08:00
e7aa014c31
* docs: init * chore: all types * docs: faq * chore: fix lint
32 lines
809 B
TypeScript
32 lines
809 B
TypeScript
import React from 'react';
|
|
import { DownloadOutlined } from '@ant-design/icons';
|
|
import { Button, Tooltip } from 'antd';
|
|
import type { GetProps } from 'antd';
|
|
|
|
type ButtonGroupProps = GetProps<typeof Button.Group>;
|
|
|
|
const CustomGroup: React.FC<ButtonGroupProps> = (props) => (
|
|
<Button.Group {...props}>
|
|
<Button type="primary">Button 1</Button>
|
|
<Button type="primary">Button 2</Button>
|
|
<Tooltip title="Tooltip">
|
|
<Button type="primary" icon={<DownloadOutlined />} disabled />
|
|
</Tooltip>
|
|
<Tooltip title="Tooltip">
|
|
<Button type="primary" icon={<DownloadOutlined />} />
|
|
</Tooltip>
|
|
</Button.Group>
|
|
);
|
|
|
|
const App: React.FC = () => (
|
|
<>
|
|
<CustomGroup size="small" />
|
|
<br />
|
|
<CustomGroup />
|
|
<br />
|
|
<CustomGroup size="large" />
|
|
</>
|
|
);
|
|
|
|
export default App;
|