UNPKG

@matthew.ngo/reform

Version:

A flexible and powerful React form management library with advanced validation, state observation, and multi-group support

25 lines (24 loc) 900 B
import { FormWizardConfig } from "./types"; import { ReformReturn } from "../../types"; /** * Hook wrapper for form wizard functionality in Reform forms * * @template T - The type of form data * @param reform - Reform hook return value * @param config - Configuration for the form wizard * @returns Form wizard state and methods * * @example * // Basic usage * const reform = useReform<UserForm>({...}); * const wizard = useReformWizard(reform, { * steps: [ * { id: 'personal', label: 'Personal Info', groupIndices: [0] }, * { id: 'contact', label: 'Contact Info', groupIndices: [1] } * ] * }); * * // Navigate between steps * <button onClick={wizard.nextStep}>Next</button> */ export declare const useReformWizard: <T extends Record<string, any>>(reform: ReformReturn<T>, config: FormWizardConfig<T>) => import("./types").FormWizardReturn<T>;