Overview
ProfileForm is a collection of components designed to facilitate the creation of a custom user details page. It provides a set of components that encapsulate the business logic for handling the user details form, allowing users to easily customize the layout, styles, labels, placeholders, and button texts.ProfileForm should be used in protected page - user should be authenticated to access it.
Example Usage
custom-profile-form.tsx
ProfileForm.Root
The root component of profile form. Encapsulates the business logic for handling user details form.Props
React elements to be rendered inside the form. ProfileForm elements should be rendered as children of ProfileForm.Root.
User details to be pre-filled in the form.
UserDetails type
Input Fields
ProfileForm has the following exported input fields:- ProfileForm.FirstNameInput - field for entering first name.
- ProfileForm.LastNameInput - field for entering last name.
- ProfileForm.PhoneNumberInput - field for entering phone number.
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.
ProfileForm.ErrorMessage
Displays an error message if there is an error in the form submission.Props
Custom class name for the error message.
ProfileForm.SubmitButton
Submit button for the form.Props
Text to be displayed on the button.
Custom class name for the button.