SchemaForm

App

Schema-driven form on the FieldSchema vocabulary (moved from next-boilerplate, OD-16). Field types: text, url, textarea, number, boolean, select, multi-select, json, color, date, datetime and repeater; showIf hides a field until another value matches, group folds fields into sections, defaults seed values and power the reset button, writes are debounced. App-bound types (media, remote-select, symbol, color-token, icon, background) are plugged in through the fieldOverrides registry and degrade to a plain input when none is given. A remote-select with searchKey (and lookupKey to resolve the label of a stored value) describes a searchable picker for the host override. zodFromSchema / validateSchemaValues validate the result; fromJsonSchema (subset) and fromFormBuilder convert other schemas. React only.

Widget settings (all field types, groups, showIf)

Preview

Shown under the title.

Appearance
Advanced
{
  "title": "CPU load",
  "live": true
}
Code
<SchemaForm schema={schema} values={values} defaults={{ refresh: 30 }} onChange={setValues} />

Validation (zod + required)

Preview

Shown under the title.

Appearance
Advanced
Code
const errors = validateSchemaValues(schema, values);
<SchemaForm schema={schema} values={values} onChange={setValues} errors={errors} />

fieldOverrides (app-bound fields)

Preview
{}
Code
<SchemaForm schema={schema} values={values} onChange={setValues}
  fieldOverrides={{ media: MediaLibraryField }} />

Adapters (JSON Schema, FormBuilder)

Preview

fromJsonSchema(...)

Broker host name

fromFormBuilder(...)

Code
<SchemaForm schema={fromJsonSchema(jsonSchema)} values={a} onChange={setA} />
<SchemaForm schema={fromFormBuilder(formSchema)} values={b} onChange={setB} />
Sourcemodules/app/SchemaForm/SchemaForm.tsx