FormProvider
Access the surrounding form's state and field-registration API. Throws when
used outside a FormProvider.
Install
Add the package and import the component.
pnpm add @hey-mike/tungstenpnpm add @hey-mike/tungstenimport { FormProvider } from '@hey-mike/tungsten';import { FormProvider } from '@hey-mike/tungsten';Props
Surface specific to <FormProvider />.
| Prop | Type | Default | Description |
|---|---|---|---|
| children* | ReactNode | — | — |
| defaultValues | Values | {} | Initial field values. |
| validate | (values: Values) => Errors | — | Form-level (cross-field) validation, e.g. confirm-password. Runs on submit AFTER per-field validation; its error map is merged over per-field errors. This is the ceiling per ADR-0003 — no async, no field arrays. |
| onValid | (values: Values) => void | — | Called with the collected values only when all validation passes. |