How to Build a Multi-Step Form in React
Multi-step forms — also called wizard forms — split a long form into smaller, focused screens. Users fill out one section at a time, which reduces cognitive load and improves completion rates. Think checkout flows, onboarding questionnaires, or insurance applications. In this tutorial you will learn how to:- Build a multi-step form with forward/back navigation
- Validate each step before the user can proceed
- Track progress across steps
- Handle final submission with all collected data
The problem with multi-step forms in vanilla React
Building a wizard form from scratch in React usually means managing a pile of state: the current step index, form data across steps, per-step validation, and navigation logic. Here is what that looks like:Vanilla React wizard — a lot of wiring
The solution: FormEngine Wizard component
FormEngine provides aWizard component that handles all of this in JSON configuration. Each step is a WizardStep that contains its own fields and validation rules. Navigation, progress, and data collection work automatically.
wizard-form.json
Rendering the wizard
SignupWizard.tsx
Adding per-step validation
In the JSON above, validation rules are already defined on individual fields (theschema.validations array). The Wizard component respects these rules: when a user clicks “Next”, FormEngine validates all fields in the current step. If any field fails, the step shows errors and blocks navigation.
For cross-field validation (such as “confirm email must match email”), see the validation guide.
Handling final submission
When the user reaches the last step and clicks “Finish”, you retrieve all collected data through theviewerRef:
Creating the same form visually
If you prefer a visual approach, you can build this exact wizard in the Online Form Builder:- Drag a Wizard component onto the canvas
- Add WizardStep components inside it
- Drag form fields into each step
- Configure validation rules in the property panel
- Click “Export JSON” and paste the result into your React app
Comparison: FormEngine vs building from scratch
| Capability | Vanilla React | FormEngine |
|---|---|---|
| Step navigation | Manual state management | Built-in |
| Per-step validation | Custom logic per step | Automatic from JSON schema |
| Progress indicator | Build your own | Built-in component |
| Add/remove steps | Edit multiple files | Edit JSON or drag-and-drop |
| Visual builder for non-devs | Not available | Designer (commercial) |
| Portable across apps | No | Single JSON file |
FAQ
Can I customize the step indicator design?
Can I customize the step indicator design?
Yes. The Wizard component inherits styles from your chosen component library (RSuite, MUI, Mantine, or your own). You can also apply custom CSS styles per component or per screen size.
Can I skip steps or make steps conditional?
Can I skip steps or make steps conditional?
Yes. Use conditional rendering with
renderWhen on WizardStep components. A step whose condition evaluates to false is hidden and skipped in navigation.How do I pre-fill the form with existing data?
How do I pre-fill the form with existing data?
Pass an
initialData prop to FormViewer with an object mapping field keys to values. See handling form data for details.Next steps
Validation guide
Add Zod-based validation, async validators, and cross-field rules.
Conditional logic
Show/hide fields and steps based on user input.
Dynamic form fields
Let users add and remove repeating sections.
FormEngine vs React Hook Form
Detailed feature comparison for evaluating alternatives.