Reference

@reckona/mreact-forms

22 public exports.

Function

FunctioncreateFormfunction createForm<TValues>(options: CreateFormOptionsWithoutSchema<TValues>): FormApi<TValues, TValues> function createForm<TValues, TSubmitValues>(options: CreateFormOptionsWithSchema<TValues, TSubmitValues>): FormApi<TValues, TSubmitValues>Creates a reactive form API from initial values, validators, and optional schema validation.

Interface

InterfaceCreateFormOptionsWithoutSchemainterface CreateFormOptionsWithoutSchemaConfigures form creation without schema-level submit value transformation.InterfaceCreateFormOptionsWithSchemainterface CreateFormOptionsWithSchemaConfigures form creation with a Standard Schema validator that may transform submit values.InterfaceFieldApiinterface FieldApiExposes state, binding, blur, and value update controls for one field.InterfaceFieldBindinginterface FieldBindingProvides DOM event handlers and current value for binding a field to an input.InterfaceFieldBindingOptionsinterface FieldBindingOptionsConfigures which DOM event updates a field binding.InterfaceFieldStateinterface FieldStateDescribes the derived state for one form field.InterfaceFormApiinterface FormApiProvides reactive form state, field access, validation, submit, reset, and error controls.InterfaceFormStateinterface FormStateDescribes the complete reactive state tracked by a form instance.InterfaceServerActionErrorsinterface ServerActionErrorsRepresents field and form errors returned by a server action.

Re-export

Re-exportInferStandardSchemaInputconst InferStandardSchemaInput: unknownRe-exports Standard Schema types used by form schema options.Re-exportInferStandardSchemaOutputconst InferStandardSchemaOutput: unknownRe-exports Standard Schema types used by form schema options.Re-exportStandardSchemaV1const StandardSchemaV1: unknownRe-exports Standard Schema types used by form schema options.Re-exportvalidateStandardSchemaconst validateStandardSchema: unknownValidates an unknown value with a Standard Schema and normalizes the result shape.

Type Alias

Type AliasCreateFormOptionstype CreateFormOptions = CreateFormOptionsWithoutSchema<TValues> | CreateFormOptionsWithSchema<TValues, TSubmitValues>Configures form creation with optional field validators and optional Standard Schema validation.Type AliasFieldNametype FieldName = Extract<keyof TValues, string>Extracts string field names from a form value object.Type AliasFieldValidatortype FieldValidator = (value: TValue, values: TValues): readonly string[] | string | undefined | Promise<readonly ...[] | string | undefined>Validates one field value against the full form values object.Type AliasFormErrorstype FormErrors = Partial<Record<FieldName<TValues> | "root", string[]>>Maps field names and the root form key to validation error messages.Type AliasFormSubmitResulttype FormSubmitResult = { data: TResult; status: "success" } | { status: "duplicate" } | { errors: FormErrors<TValues>; status: "invalid" } | { error: unknown; status: "error" }Reports the result of a form submit handler after validation and error capture.Type AliasFormValidateModetype FormValidateMode = "change" | "blur" | "submit"Names the form events that can trigger validation.Type AliasFormValidationResulttype FormValidationResult = { success: true; value: TSubmitValues } | { errors: FormErrors<TValues>; success: false }Reports either successful normalized submit values or form validation errors.Type AliasFormValuestype FormValues = Record<string, unknown>Represents the object shape managed by a form instance.