Skip to Content

Fields

SchemaForm, and the field kinds that tables, lists and forms use.

SchemaForm

SchemaForm builds a form from a JSON Schema. It says what is wrong under each field that does not fit.

It handles these types:

  • strings, numbers and booleans
  • enums
  • optional fields
  • nested objects
  • arrays of scalars
  • arrays of small records, as a DataList

Some strings and numbers get their own control.

In the schemaControl
writeOnly, format: "password", or a name in secretFieldsA password input
A name in storedSecretsA secret the app has stored. It is not required, and left out when blank
x-multilineA text area
A numberA NumberField. x-unit sets the unit
A number with both bounds and "x-control": "slider"A Slider with its field
Connect a hostRequired fields, an enum, a number with limits, a nested group, a list and a switch. Blank optional fields are left out of what it sends, numbers are numbers, and the untouched optional group is missing.
Open the example ↗
Numbers and slidersnumber and integer schemas are NumberFields (x-unit adds the unit); a number with both bounds and "x-control": "slider" is a Slider with a field for the exact value.
Open the example ↗
Settings from a schema, with a stored secretAn integration declares its settings as JSON Schema; SchemaForm draws them. token is writeOnly and already stored: it is not required, shows as set, and is left out of what is sent when blank.
Open the example ↗

Field kinds

Each kind of value is written once. Tables, lists, record pages, create dialogs, settings, connection forms, the dialogs for parameters and filters all draw values through it.

The kinds are in src/fields/kinds/:

KindValue
text, longtextOne line, or several
richtextA RichTextEditor document, see Rich text editor
number, currency, bytesNumbers, with a unit or a currency
booleanYes or no
enumOne of a set of values, as a chip or a dot and its word
date, datetimeA day, or a day and a time
tagsA list of strings
refA reference to another record
secretA value that is written and not read back
json, blob, vectorStructured data, files and vectors

A kind draws its value in a cell, a row or a chip line when compact is set. Its editor is inline on a record page, or boxed in a dialog or form. Inline editors hand over the value when the person leaves them or presses Enter, and boxed editors hand over every change.

The field runtime is a provider, so the fields have no network code.

Every kind, every modeOne row per kind, one column per mode: the cell of a table, the value, the editor that edits in place, the control of a form, the filter. Each is the kind's own implementation; edit one and the others follow.
Open the example ↗
A form of every kindThe rows of a create dialog, a connection form and a params dialog: label above, control, and what was refused under the field in words that do not repeat its name.
Open the example ↗
Field kinds in the gallery ↗
Edit on GitHub

Last updated on

On this page