Skip to content
Star

PxFormWizard

A multi-step form wizard that combines a built-in step navigation header with PxSchemaForm dynamic rendering and per-step Zod schema validation.

Basic Usage

Multi-Step Schema Form Wizard
Select...

Props

Props
PropTypeDefaultDescription
stepsWizardStep[][]Array of step configuration objects (see WizardStep interface below).
modelValueRecord<string, unknown>{}Two-way bound form state across all steps.
loadingbooleanfalseDisables step buttons and displays a loading spinner.
linearbooleantrueWhen true, users cannot jump ahead to steps without successfully completing previous steps.
nextLabelstring'Siguiente'Label for the advance button.
previousLabelstring'Anterior'Label for the back button.
completeLabelstring'Completar'Label for the submit button on the final step.
loadingLabelstring'Guardando...'Text shown when loading is active.

WizardStep Interface

ts
interface WizardStep {
  id: string | number
  title: string
  description?: string
  icon?: Component
  schema: FormSchemaField[]
  zodSchema?: ZodSchema<any>
  validate?: (
    stepData: Record<string, unknown>,
    allData: Record<string, unknown>
  ) => boolean | Promise<boolean> | string | Promise<string>
}

Emits

Emits
EventPayloadDescription
update:modelValueRecord<string, unknown>Emitted whenever any field value changes.
step-changestepIndex: number, step: WizardStepEmitted when moving between steps.
completeRecord<string, unknown>Emitted on the last step after all validations pass.
error{ stepIndex: number, message: string }Emitted when step validation fails.

Slots

Slots
SlotScopeDescription
before-form{ step: WizardStep, stepIndex: number }Content placed before the active step's schema form.
after-form{ step: WizardStep, stepIndex: number }Content placed after the active step's schema form.
actions{ step: WizardStep, stepIndex: number, isLastStep: boolean }Custom replacement for next / complete action buttons.

Built with VitePress