The "One Hook" Model
Eliminate environment parity issues. Define your logic once using useFormBridge and deploy to web, native, or desktop shells without forking your state machine.
The primary interface for React FormBridge. A single, type-safe hook that orchestrates cross-platform form state, validation, and lifecycle events.
Eliminate environment parity issues. Define your logic once using useFormBridge and deploy to web, native, or desktop shells without forking your state machine.
| Property | Type | Description |
|---|---|---|
validateOn | 'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | Initial validation timing for builder rules. Defaults to `onBlur`. |
revalidateOn | 'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | Follow-up validation trigger after a field has already been interacted with. |
validatorBridge | SchemaValidatorBridge | Optional schema adapter for Zod, Yup, Joi, or Valibot validation. |
persist | { key: string; storage?: "local" | "session" | "async" | StorageAdapter; ttl?: number; exclude?: string[]; debounce?: number; onRestore?: (values: Record<string, unknown>) => void; onSaveError?: (error: unknown) => void; version?: string; } | Draft save and restore behavior with storage, TTL, debounce, and exclusions. |
formKey | string | Recreate the runtime when the surrounding business context changes. |
initialValues | Partial<SchemaValues<typeof schema>> | Seed the runtime from existing values before the user edits the form. |
globalDefaults | Partial<SchemaValues<typeof schema>> | Seed the runtime from existing values before the user edits the form. |
useFormBridge() returns the runtime surface needed to render forms, inspect live state, and drop into custom UI where needed.
Advanced context wrapper that exposes the form runtime to consumers rendered outside `<Form>`.
generated wrapperGenerated wrapper component with submit lifecycle and `Form.Submit` helpers.
typed generated fieldsTyped generated field components keyed by the schema field names.
standalone errorStandalone error renderer for a single field name, useful in custom layouts.
standalone labelStandalone label renderer for a single field name, useful in custom layouts.
custom renderer bridgeField-scoped runtime for fully custom UI while keeping the schema contract intact.
reactive stateReactive values, errors, dirty flags, touched state, and submit status.
conditional runtimePer-field visibility, required, and disabled flags computed from conditional rules.
draft lifecycle`true` while a persisted draft is being restored into the runtime.
draft lifecycle`true` once a previously saved draft was found and hydrated.
draft helperDelete the saved draft from the configured storage backend.
draft helperPersist the current values immediately without waiting for the debounce window.
imperative actionSet one field value programmatically from outside the form.
imperative actionRead one field value on demand without subscribing to updates.
imperative actionRead the full value object on demand without subscribing to updates.
imperative actionValidate a single field, a list of fields, or the entire form on demand.
imperative actionReset the form back to schema defaults or to a provided partial value object.
imperative actionPush a manual field error from imperative code or async handlers.
imperative actionClear errors for one field, a list of fields, or the entire form.
reactive helperReactive single-field read that re-renders on every value change.
reactive helperReactive full-values read that re-renders on every value change.
imperative actionImperatively trigger submission through the same pipeline as `Form.Submit`.
// Property '"doesNotExist"' is not assignable to the schema keys
const { setValue } = useFormBridge(schema)
setValue('fullName', 'Ava Stone')
setValue('doesNotExist', 'x')