import React, { useState } from 'react'; import { Button, Form, Input, Radio } from 'antd'; type LayoutType = Parameters[0]['layout']; const App: React.FC = () => { const [form] = Form.useForm(); const [formLayout, setFormLayout] = useState('horizontal'); const onFormLayoutChange = ({ layout }: { layout: LayoutType }) => { setFormLayout(layout); }; const formItemLayout = formLayout === 'horizontal' ? { labelCol: { span: 4 }, wrapperCol: { span: 14 } } : null; const buttonItemLayout = formLayout === 'horizontal' ? { wrapperCol: { span: 14, offset: 4 } } : null; return (
Horizontal Vertical Inline
); }; export default App;