ValyroUI Русская версия

Multi-step Form

Multi-step form: per-step validation, skipping, review before submit, drafts. Pro · Forms and input › Whole forms and filters

Wizard on top of Stepper: per-step (async) validation, back / next / skip, a review step, draft saving and focus on the step heading after every move. Below 560px of width the step list collapses into a "Step 2 of 4" bar.

Installation

npx valyro-cli@latest login
npx valyro-cli@latest add multi-step-form
npm install valyro-ui-pro

import 'valyro-ui-pro/styles.css';
import { MultiStepForm } from 'valyro-ui-pro';

Props

PropTypeDefault
steps *MultiStepFormStep[]Steps in order, each with its title, fields and optional validator; only the current one is rendered.
stepnumberIndex of the current step.
defaultStepnumber0Initial step when uncontrolled.
onStepChange(step: number) => voidCalled with the new step when it changes.
onSubmit *() => void | Promise<void>Called on the last step once it validates. Reject (or throw) with an Error to show its message.
onSaveDraft(step: number) => void | Promise<void>Shows a "Save draft" button; receives the current step. Reject to show an error.
headingLevel2 | 3 | 42Level of the step heading that receives focus on every step change. Default 2.
labelsPartial<MultiStepFormLabels>Overrides for the built-in English text; keys left out keep their defaults.

Related components

Previous: Form Field · Next: Form Autosave Status · All Forms and input