React FormBridge is headless: it does not generate inputs or impose a component library. Use fieldController(name) to connect schema-owned behavior to UI owned by your application.
- The controller exposes value, events, validation state, semantic metadata, visibility, and focus registration.
- Web and native share the schema, but each platform renders its own accessible controls.
- Put layout, styling, input variants, and design-system adapters in your UI layer.
Compose a form
Create controllers during render, pass them to your UI components, and submit with handleSubmit on web or submit on native. onSubmit belongs to the hook options; the submit helpers run the same validation pipeline.
Build design-system adapters
Wrap fieldController() once per control family. A text adapter, checkbox adapter, select adapter, masked-input adapter, and file adapter are usually enough. This keeps form screens concise without coupling FormBridge itself to your UI kit.
Type-specific controllers add useful metadata:
- select/radio:
options - masked fields:
displayValue,rawValue,maskComplete,format(), andunmask() - OTP:
otpLength,digits,setDigit(),clear(), andotpComplete
Use field.custom() for a new value model
field.custom(defaultValue) adds a typed value model to the schema. Rendering still happens through its controller, exactly like built-in fields.