Skip to main content

Overview

SignUpForm is a collection of components designed to facilitate the creation of a custom sign-up flow. It provides a set of components that encapsulate the business logic for handling forms, allowing users to easily customize the layout, styles, labels, placeholders, and button texts.

Example Usage

custom-sign-up-form.tsx

Components

SignUpForm.Root

The root component of sign-up form. It encapsulates business logic for handling sign-up form.
SignUpForm is responsible for creating a user. You need to implement a VerificationForm(from SignUpElement) that displays and handle otp inputs logic(entering the code from email) and complete registration flow.

Props

ReactNode
React elements to be rendered inside the form. SignUpForm elements should be rendered as children of SignUpForm.Root.
callback
required
A callback function that is called when the sign-up process is successfully completed.
string
required
Verification url used to redirect user to verification page from email. It should contain a placeholder for verification code.
callback
A callback function that is called when error happened during the sign-in process.
object
default values object structure
Object with default values for email, last name and first name fields. Using default values you can pre-fill the form fields and make the sign-up process faster for the user skipping EmailInput, FirstNameInput and LastNameInput fields.
Record<string, string>
Optional metadata to be passed to iam. Metadata is a key-value pair that can be used to store additional information about the user.

Input Fields

SignUpForm has the following exported input fields:
  • SignUpForm.FirstNameInput - field for entering first name. Optional, if default values are provided.
  • SignUpForm.LastNameInput - field for entering last name. Optional, if default values are provided.
  • SignUpForm.EmailInput - field for entering email. Optional, if default values are provided.
  • SignUpForm.PasswordInput - field for entering password.
  • SignUpForm.ConfirmPasswordInput - field for entering password.
All these fields have similar props listed below:

Props

string
Label for input field. Optional, if not provided the label will not be rendered.
string
Placeholder for input field. Optional, if not provided the placeholder will not be rendered.
string
Custom class name for label.
string
Custom class name for input.

SignInForm.ErrorMessage

Displays an error message if there is an error in the form submission.

Props

string
Custom class name for the error message.

SignInForm.SubmitButton

Submit button for the form.

Props

string
Text to be displayed on the button.
string
Custom class name for the button.