Overview
SecurityForm is a collection of components designed to facilitate creation of a custom password update form. It provides a set of components that encapsulate the business logic for handling the password update form, allowing users to easily customize layout, styles, labels, placeholders, and button texts.SecurityForm should be used in protected page - user should be authenticated to access it.
Example Usage
custom-security-form.tsx
SecurityForm.Root
The root component of security form. Encapsulates the business logic for handling security form.Props
React elements to be rendered inside the form. SecurityForm elements should be rendered as children of SecurityForm.Root.
Input Fields
SecurityForm has the following exported input fields:- SecurityForm.CurrentPasswordInput - field for entering current password.
- SecurityForm.NewPasswordInput - field for entering new password.
- SecurityForm.ConfirmPasswordInput - field for entering new password confirmation.
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.
SecurityForm.ErrorMessage
Displays an error message if there is an error in the form submission.Props
Custom class name for the error message.
SecurityForm.SubmitButton
Submit button for the form.Props
Text to be displayed on the button.
Custom class name for the button.