← Back to authentication blocks
signup-01
A simple, centered signup form with name, email, password and confirm password fields. Use as the starting point for a registration page.
Code
import * as React from "react"
import { cn } from "@/lib/utils"
import { Button } from "@/components/ui/button"
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card"
import { Input } from "@/components/ui/input"
import { Label } from "@/components/ui/label"
export function SignupForm({
className,
...props
}: React.ComponentProps<"div">) {
return (
<div className={cn("flex flex-col gap-6", className)} {...props}>
<Card>
<CardHeader>
<CardTitle>Create an account</CardTitle>
<CardDescription>
Enter your details below to create your account
</CardDescription>
</CardHeader>
<CardContent>
<form>
<div className="flex flex-col gap-6">
<div className="grid gap-2">
<Label htmlFor="name">Name</Label>
<Input id="name" type="text" placeholder="Jane Doe" required />
</div>
<div className="grid gap-2">
<Label htmlFor="email">Email</Label>
<Input
id="email"
type="email"
placeholder="m@example.com"
required
/>
</div>
<div className="grid gap-2">
<Label htmlFor="password">Password</Label>
<Input id="password" type="password" required />
</div>
<div className="grid gap-2">
<Label htmlFor="confirm-password">Confirm password</Label>
<Input id="confirm-password" type="password" required />
</div>
<Button type="submit" className="w-full">
Create account
</Button>
</div>
<div className="mt-4 text-center text-sm">
Already have an account?{" "}
<a href="#" className="underline underline-offset-4">
Login
</a>
</div>
</form>
</CardContent>
</Card>
</div>
)
}