Current reactive state returned by useFormBridge().
- Read from it to disable buttons, show summaries, build progress UI, or inspect submit lifecycle
- It is already derived from the schema and the current user interactions
State.tsts
| 1 | form.state.values |
| 2 | form.state.errors |
| 3 | form.state.touched |
| 4 | form.state.dirty |
| 5 | form.state.status // 'idle' | 'validating' | 'submitting' | 'success' | 'error' |
| 6 | form.state.isValid |
| 7 | form.state.isDirty |
| 8 | form.state.isSubmitting |
| 9 | form.state.isSubmitSuccess |
| 10 | form.state.isSubmitError |
| 11 | form.state.submitCount |
Complete state shape
Complete state surface:
| Method | Type | Description |
|---|---|---|
values | SchemaValues | Current field values, typed from the schema. Each key matches a schema field; each value is the inferred runtime type (string, number, File, …). |
errors | Record<string, string> | Per-field error messages. A key is present only when the field currently has an error; absent keys mean the field is valid. Messages are plain strings produced by the validator pipeline (Zod/Yup/Joi/Valibot/built-in). |
touched | Record<string, boolean> | Per-field "has been touched" flags. A field becomes touched when the user blurs it at least once. Used to gate error visibility so forms don't scream red on first render. |
dirty | Record<string, boolean> | Per-field "has been modified" flags. Set to true the first time a field's value diverges from its initial value, and cleared if the user reverts it. |
status | 'idle' | 'validating' | 'submitting' | 'success' | 'error' | Coarse lifecycle state - see FormStatus. Prefer the boolean helpers below (isSubmitting, isSubmitSuccess, …) for UI conditions. |
isValid | boolean | true when errors is empty. Reflects current validation, not whether the user has attempted submit - use with submitCount if you only want to show errors after a submit attempt. |
isDirty | boolean | true when at least one field is dirty. Useful for "unsaved changes" prompts and enabling Save buttons. |
isSubmitting | boolean | true while status is 'submitting' or 'validating'. Use this to disable inputs or show a spinner during submission. |
isSubmitSuccess | boolean | true when the last submission completed successfully. |
isSubmitError | boolean | true when the last submission failed (threw or returned a rejection). |
submitCount | number | Monotonic counter incremented on every submit attempt (successful or not). Use it as a signal that the user has tried to submit at least once. |
formLevelError | string | null | Form-level validation error produced by cross-field rules (e.g. refine() / superRefine() in a createSchema() pipeline). null when there is no form-level validation issue. |
submitError | string | null | Error message produced by the most recent failed onSubmit call - for example an API/network error. null when the last submission succeeded or no submission has happened yet. |