Skip to main content

Overview

UpdatePasswordForm is a collection of components designed to facilitate the creation of a custom forgot password flow. It provides a set of components that encapsulate the business logic for handling the update password form, allowing users to easily customize the layout, styles, labels, placeholders, and button texts.

Example Usage

custom-update-password-form.tsx

UpdatePasswordForm.Root

The root component of password update form. It encapsulates business logic for password update, entering and resending verification code processes.
UpdatePasswordForm is responsible for password updating for users who requested verification code by email in RequestCodeForm (from ForgotPasswordElements).

Props

ReactNode
React elements to be rendered inside the form. UpdatePasswordForm elements should be rendered as children of UpdatePasswordForm.Root.
callback
required
A callback function that is called when password is successfully updated.
string
Users e-mail for resending verification code.
string
required
Reset password url used to redirect user to reset password page from email. It should contain a placeholder for the reset password code.

VerifyForm.OtpInputs

Displays input fields for the entering one-time password (OTP).

Props

ltr | rtl
default:"ltr"
Direction of the input fields (e.g., “ltr” or “rtl”).

Input Fields

UpdatePasswordForm has the following exported input fields:
  • UpdatePasswordForm.PasswordInput - field for entering password.
  • UpdatePasswordForm.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.

UpdatePasswordForm.ErrorMessage

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

Props

string
Custom class name for the error message.

UpdatePasswordForm.SubmitButton

Submit button for the form.

Props

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