Skip to main content

Wizard Form

<RavenWizardForm> renders a multi-step form with a progress indicator, per-step validation, and Prev/Next navigation.

Live Demo

1
Account
2
Profile
3
Preferences

Set up your account credentials.


RavenWizardForm Props

PropTypeDescription
stepsWizardStep[]Required. Array of step definitions
onSubmit(values) => void | Promise<void>Required. Final submit handler
defaultValuesRecord<string, unknown>Initial values shared across all steps
adapterFormAdapterOverride form adapter
uiUIAdapterOverride UI adapter
submitLabelstringLabel for the final submit button
showStateInspectorbooleanShow inline state inspector

WizardStep Shape

interface WizardStep {
id: string; // unique identifier
title: string; // shown in the progress bar
description?: string; // shown below the progress indicator
icon?: string; // icon or emoji shown in the step circle
fields: FormField[]; // fields rendered in this step
columns?: number; // column grid override (default 12)
}

Step Validation

When the user clicks Next, the engine calls formAdapter.useTrigger()? on only the current step fields. If any field fails, navigation is blocked and errors are shown.

info

RavenRHFAdapter supports step validation via RHF's trigger() internally.

Shared Form State

All steps share a single form state instance. Values from earlier steps are preserved as the user navigates. onSubmit receives all values from all steps merged:

{
"username": "cooldev",
"email": "me@example.com",
"firstName": "Cool",
"plan": "pro"
}