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
Provides translation support for labels, descriptions, and validation messages. Optional — if omitted, all text values are treated as plain strings.
validationTranslation maps RHF rule names to translation keys so validation messages are translated automatically — without putting translation keys into field config. For a full guide, see 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:

