You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

22 lines
725 B

import React, { useState } from 'react';
import { FloatButton, Radio } from 'antd';
import type { RadioChangeEvent, FloatButtonProps } from 'antd';
import { CustomerServiceOutlined } from '@ant-design/icons';
const App: React.FC = () => {
const [shape, setShape] = useState<FloatButtonProps['shape']>('circle');
const onChange = (e: RadioChangeEvent) => {
setShape(e.target.value);
};
return (
<>
<Radio.Group onChange={onChange} value={shape} style={{ margin: 20 }}>
<Radio value="circle"></Radio>
<Radio value="square"></Radio>
</Radio.Group>
<FloatButton icon={<CustomerServiceOutlined />} type="primary" shape={shape} />
</>
);
};
export default App;