Overview
RequestCodeForm 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 request code form, allowing users to easily customize the layout, styles, labels, placeholders, and button texts.Example Usage
custom-request-code-form.tsx
RequestCodeForm.Root
The root component of request code form. It encapsulates business logic for handling code requesting process.RequestCodeForm is responsible only for requesting code. You need to implement a UpdatePasswordForm
(from ForgotPasswordElements) that handles password updating process.
Props
React elements to be rendered inside the form. RequestCodeForm elements should be rendered as children of RequestCodeForm.Root.
A callback function that is called when code is successfully requested.
Default email value for the email input field.
Reset password url used to redirect user to reset password page from email.
It should contain a placeholder for the reset password code.
RequestCodeForm.EmailInput
Field for email of user’s for which a password reset code will be requested.Props
Label for input field. Optional, if not provided the label will not be rendered.
Placeholder for input field. Optional, if not provided the placeholder will not be rendered.
Custom class name for label.
Custom class name for input.
RequestCodeForm.ErrorMessage
Displays an error message if there is an error in the form submission.Props
Custom class name for the error message.
RequestCodeForm.SubmitButton
Submit button for the form.Props
Text to be displayed on the button.
Custom class name for the button.