While working with ant design form, I have serious problem with responsiveness.
import { From, Input, Button } from 'antd'
const { Item } = Form;
const layout = {
labelCol: { span: 8 },
wrapperCol: { span: 16 },
};
const tailLayout = {
wrapperCol: { offset: 8, span: 16 },
};
const ExampleAntForm = () => {
{
return (
<Form {...layout}>
<Item label="Name" name="username"> <Input type="text"/> </Item>
<Item label="Password" name="password"> <Input type="password"/> </Item>
<Item {...tailLayout}>
<Button htmlType="submit" type="primary"> Submit </Button>
</Item>
</Form>
)
}
But in this case, I'd like to apply layout depending on screen size.
Ideally like below,
const layout = {
labelCol = { span: { sm: 24, md: 8, lg: 6 }}
wrapperCol = { span: { sm: 24, md: 16, lg: 12 }}
}
How to approach this responsiveness using the layout
props in ant design Form
component?
Orr just let me know any other potential solutions for my issue.