
A form split into two columns of fields with a shared header and footer actions. Use it for longer profiles or billing details that fit a wider screen.
@shadcn-ui-blocks
import { Button } from "@/components/ui/button";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { Separator } from "@/components/ui/separator";
import { Textarea } from "@/components/ui/textarea";
export default function TwoColumnForm() {
return (
<div className="container mx-auto px-4 md:px-6 2xl:max-w-[1400px] py-10">
<Card>
<CardHeader>
<CardTitle>Profile Settings</CardTitle>
</CardHeader>
<CardContent>
<form>
<div className="space-y-8">
{/* Personal Information */}
<div>
<h3 className="text-lg font-medium">Personal Information</h3>
<p className="text-sm text-muted-foreground">
Update your personal details here.
</p>
<div className="mt-6 grid grid-cols-1 gap-x-6 gap-y-6 sm:grid-cols-2">
<div className="space-y-2">
<Label htmlFor="first-name">First name</Label>
<Input id="first-name" placeholder="Enter first name" />
</div>
<div className="space-y-2">
<Label htmlFor="last-name">Last name</Label>
<Input id="last-name" placeholder="Enter last name" />
</div>
<div className="space-y-2">
<Label htmlFor="email">Email</Label>
<Input id="email" type="email" placeholder="Enter email" />
</div>
<div className="space-y-2">
<Label htmlFor="phone">Phone number</Label>
<Input
id="phone"
type="tel"
placeholder="Enter phone number"
/>
</div>
<div className="col-span-full space-y-2">
<Label htmlFor="about">About</Label>
<Textarea
id="about"
placeholder="Write a few sentences about yourself"
/>
</div>
</div>
</div>
<Separator />
{/* Address Information */}
<div>
<h3 className="text-lg font-medium">Address Information</h3>
<p className="text-sm text-muted-foreground">
Update your shipping address.
</p>
<div className="mt-6 grid grid-cols-1 gap-x-6 gap-y-6 sm:grid-cols-2">
<div className="col-span-full space-y-2">
<Label htmlFor="street">Street address</Label>
<Input id="street" placeholder="Enter street address" />
</div>
<div className="space-y-2">
<Label htmlFor="city">City</Label>
<Input id="city" placeholder="Enter city" />
</div>
<div className="space-y-2">
<Label htmlFor="state">State / Province</Label>
<Input id="state" placeholder="Enter state" />
</div>
<div className="space-y-2">
<Label htmlFor="postal-code">ZIP / Postal code</Label>
<Input id="postal-code" placeholder="Enter postal code" />
</div>
<div className="space-y-2">
<Label htmlFor="country">Country</Label>
<Input id="country" placeholder="Enter country" />
</div>
</div>
</div>
<div className="flex justify-end gap-4">
<Button variant="outline">Cancel</Button>
<Button>Save Changes</Button>
</div>
</div>
</form>
</CardContent>
</Card>
</div>
);
}































