All blocks

Signup form

Name, email, password, and terms acceptance.

Preview

Create account
Get started in under a minute.

At least 8 characters.

Code

import {
  Button,
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
  Checkbox,
  Field,
  FieldDescription,
  FieldLabel,
  Input,
  Label,
} from "@smaller-earth/ui"

export function SignupForm() {
  return (
    <Card className="w-full max-w-md">
      <CardHeader>
        <CardTitle>Create account</CardTitle>
        <CardDescription>Get started in under a minute.</CardDescription>
      </CardHeader>
      <CardContent>
        <form className="space-y-4">
          <div className="grid grid-cols-2 gap-3">
            <Field>
              <FieldLabel htmlFor="first-name">First name</FieldLabel>
              <Input id="first-name" />
            </Field>
            <Field>
              <FieldLabel htmlFor="last-name">Last name</FieldLabel>
              <Input id="last-name" />
            </Field>
          </div>
          <Field>
            <FieldLabel htmlFor="signup-email">Email</FieldLabel>
            <Input id="signup-email" type="email" />
          </Field>
          <Field>
            <FieldLabel htmlFor="signup-password">Password</FieldLabel>
            <Input id="signup-password" type="password" />
            <FieldDescription>At least 8 characters.</FieldDescription>
          </Field>
          <div className="flex items-start gap-2">
            <Checkbox id="terms" className="mt-0.5" />
            <Label htmlFor="terms" className="text-sm font-normal text-muted-foreground">
              I agree to the terms and privacy policy.
            </Label>
          </div>
          <Button className="w-full">Create account</Button>
        </form>
      </CardContent>
    </Card>
  )
}