DS0
Patterns

Signup Form

A complete registration form with name, email, password, terms agreement, and optional social signup.

Overview

The SignupForm recipe provides a registration form with name, email, password, password confirmation, terms checkbox, and optional social signup providers. It includes client-side validation for password matching and required fields.

Create account

Get started for free

Already have an account? Sign in

Usage

import { SignupForm } from '@/recipes/signup-form';

<SignupForm
  onSubmit={({ name, email, password }) => createAccount(name, email, password)}
  onLogin={() => navigate('/login')}
  termsUrl="/terms"
  privacyUrl="/privacy"
/>

With Social Providers

<SignupForm
  onSubmit={handleSubmit}
  onSocialSignup={(provider) => socialSignUp(provider)}
  socialProviders={[
    { name: 'Google', icon: <GoogleIcon /> },
    { name: 'GitHub', icon: <GitHubIcon /> },
  ]}
/>

With Password Requirements

<SignupForm
  onSubmit={handleSubmit}
  passwordRequirements={[
    'At least 8 characters',
    'One uppercase letter',
    'One number',
  ]}
/>

API Reference

PropTypeDefaultDescription
onSubmit(data: { name: string; email: string; password: string }) => voidForm submission handler
onLogin() => voidSwitch to login handler
onSocialSignup(provider: string) => voidSocial signup handler
socialProvidersArray<{ name: string; icon: ReactNode }>Social providers
titlestring'Create an account'Card title
descriptionstring'Get started in seconds'Card description
isLoadingbooleanfalseLoading state
errorstringForm-level error
termsUrlstringTerms of service URL
privacyUrlstringPrivacy policy URL
passwordRequirementsstring[]Password requirements list
classNamestringAdditional CSS classes

On this page