ApplicationMulti-Step Form
Multi-Step Form
A customizable multi-step form component with progress indicator and animations.
Preview
1
Personal Info2
Address3
ConfirmationPersonal Information
Installation
Before using the MultiStepForm
component, install the necessary dependency:
Code
Usage
Basic Setup
To use the MultiStepForm
component:
- Define your form steps as an array of objects containing a
title
and acomponent
. - Pass the
steps
array and a completion handler (onComplete
) to theMultiStepForm
component.
Step Components
Each step in the form is defined as a React component. These components should handle their own validation and communicate data back to the parent MultiStepForm
through the updateFormData
callback.
Example Steps
Personal Info Step
Address Step
Similar to the PersonalInfoStep
, this step collects address details.
Confirmation Step
This step displays a summary of the user's input.
Props
Multi Step Form
Prop | Type | Default |
---|---|---|
steps | StepProp[] | - |
onComplete | (data: any) => void | - |
className | string | - |
Step Props
Prop | Type | Default |
---|---|---|
title | string | - |
component | ReactElement<StepProps, string | JSXElementConstructor<any>> | - |
Example Output
After completing all steps, the onComplete
function is called with the collected data:
Edit on GitHub
Last updated on