setupForm
BlueForm does not expose a single global <Form /> component. Instead, you create a form system bounded to a base configuration through a setup step. This is the entry point of any BlueForm-powered app.
setupForm returns a tuple of three values — destructure and name them as you see fit:
Form, defineConfig, and Section are the names used throughout this documentation. Since they come from destructuring an array, you can rename them to anything that fits your codebase.
Options
renderRoot
Controls how the root form element is rendered. This keeps BlueForm layout-agnostic and platform-independent.
renderRoot receives children, onSubmit, and a curated set of form methods
spread directly onto the args — formState, setValue, reset, trigger,
control, and others. See the full list below.
renderRoot can be overridden per <Form /> instance.
If neither setupForm nor the <Form /> instance provides renderRoot, an error will be thrown at run time.
fieldMapping
Maps field type names to React components. Each entry tells the engine which component to render when a field config declares a given type.
The mapping is enforced at compile time — declaring an unknown type in form config produces a TypeScript error. fieldMapping cannot be overridden per <Form /> instance — it is fixed at setup time to preserve type safety.
For how to author field components, see Field authoring.
i18nConfig
Translates labels, descriptions, placeholders and error messages through one t function. Optional: if omitted, all text is shown as written. Put what is fixed here; a <Form> can pass its own i18nConfig, merged key by key over this one (v0.22+), usually just t when it changes with the language.
validationTranslation maps the built-in rules to message keys, so rules stay plain (required: true). Full guide: Internationalization.
formOptions
Default options passed to RHF's useForm for every form instance created from this setup. Accepts a subset of useForm options — behavior-level settings that make sense app-wide:
Per-form concerns — resolver, defaultValues, context — belong on the <Form /> instance instead. Per-form formOptions merges over these defaults, so individual forms can override specific keys without losing the rest:

