Avenra
React Step FormAPI Reference
React Step FormAPI Reference

FormWizard

The root component for step flow, validation, and submission.

The root component that wires step flow, validation, persistence, and submission.

Basic usage

<FormWizard
    schema={schema}
    steps={steps}
    defaultValues={{ email: "" }}
    onSubmit={(values) => console.log(values)}
/>

Props

Prop

Type

Type details

type StepDefinition<TValues> = {
    id: string;
    component: React.ComponentType;
    fields?: FieldPath<TValues>[];
    meta?: Record<string, unknown>;
};

type ZodSchemaLike<TValues> = {
    safeParse(data: unknown):
        | { success: true; data: TValues }
        | {
              success: false;
              error: {
                  issues: Array<{ path: (string | number)[]; message: string }>;
              };
          };
};

On this page