Field Configuration Reference

Field Configuration Reference

This is the complete reference for IFieldConfig, the primary consumer-facing type used to define forms as JSON configuration. Each form is defined as a Record<string, IFieldConfig> where the key is the field name and the value is its configuration.


Complete Property Reference

PropertyTypeDefaultDescription
typestringundefinedUI component type key (e.g., "Textbox", "Dropdown", "Toggle"). Must match a registered component.
requiredbooleanfalseWhether the field is required for form submission. Can be overridden by rules.
hiddenbooleanfalseWhether the field is hidden (not rendered). Hidden fields skip validation.
readOnlybooleanfalseWhether the field is read-only (rendered but not editable).
disabledbooleanfalseWhether the field is disabled at the layout level.
labelstringundefinedDisplay label for the field.
defaultValuestring | number | booleanundefinedDefault value applied when the field is visible and its current value is null.
computedValuestringundefinedExpression string evaluated reactively. Uses $values.fieldName or "$fn.functionName()".
computeOnCreateOnlybooleanfalseIf true, the computed value runs only during create (not edit).
confirmInputbooleanfalseWhether changing dependents triggers a confirmation modal.
hideOnCreatebooleanfalseIf true, the field is not rendered in create mode.
skipLayoutReadOnlybooleanfalseIf true, the field ignores layout-level disabled/readOnly override.
rulesIRule[]undefinedDeclarative dependency rules.
validateIValidationRule[]undefinedValidation rules (sync, async, and cross-field).
optionsIOption[]undefinedStatic dropdown options.
configRecord<string, unknown>undefinedArbitrary configuration passed through to the field component.
itemsRecord<string, IFieldConfig>undefinedField configs for repeating field array items.
minItemsnumberundefinedMinimum number of items in a field array.
maxItemsnumberundefinedMaximum number of items in a field array.

Template Field References

In addition to IFieldConfig, field entries can be template references (ITemplateFieldRef). The type is discriminated by the presence of templateRef:

  • If templateRef is present, the entry is a template reference
  • If type and label are present, the entry is a standard field config

ITemplateFieldRef Properties

PropertyTypeDefaultDescription
templateRefstring(required)Name of a registered or inline template to expand.
templateParamsRecord<string, unknown>{}Parameter values passed to the template.
templateOverridesRecord<string, Partial<IFieldConfig>>undefinedPer-field config patches applied after template expansion.
defaultValuesRecord<string, unknown>undefinedDefault values for the expanded template fields.

Example

const formConfig: IFormConfig = {
  version: 2,
  fields: {
    // Standard field config (type + label present)
    name: { type: "Textbox", label: "Name", required: true },

    // Template reference (templateRef present)
    shipping: {
      templateRef: "address",
      templateParams: { country: "US", required: true },
    },

    // Template reference with overrides and defaults
    billing: {
      templateRef: "address",
      templateParams: { country: "US" },
      templateOverrides: {
        zip: { required: false },
      },
      defaultValues: {
        street: "123 Main St",
      },
    },
  },
};

During template resolution, each templateRef entry is expanded into the template's fields, prefixed by the entry key. For example, shipping expands to shipping.street, shipping.city, shipping.state, and shipping.zip.

See the Templates & Composition guide for full documentation on defining and using templates.


Basic Example

const fieldConfigs = {
  title: {
    type: "Textbox",
    required: true,
    label: "Project Title",
  },
  status: {
    type: "Dropdown",
    required: true,
    label: "Status",
    options: [
      { value: "Active", label: "Active" },
      { value: "Inactive", label: "Inactive" },
    ],
  },
  notes: {
    type: "Textarea",
    label: "Notes",
  },
};

Rules

Rules are defined as an IRule[] array on a field. See the Rules Engine page for full details.


Validation

Reference validators by name in IFieldConfig.validate:

{
  email: {
    type: "Textbox",
    label: "Email",
    validate: [
      { validator: "EmailValidation" },
      { validator: "checkEmailUnique", async: true, debounceMs: 500 },
    ],
  },
}

See the Validation page for the full validator reference.


Computed Values

{
  total: {
    type: "Number",
    label: "Total",
    readOnly: true,
    computedValue: "$values.quantity * $values.unitPrice",
  },
}

See the Expression Syntax page for the full expression reference.


Built-in Component Types

KeyDescription
"Textbox"Single-line text input
"Dropdown"Single-select dropdown
"Toggle"Boolean toggle switch
"Number"Numeric input
"Multiselect"Multi-select dropdown
"DateControl"Date picker
"Slider"Range slider
"DynamicFragment"Hidden fragment
"MultiSelectSearch"Multi-select with search
"Textarea"Multi-line text input
"DocumentLinks"URL link CRUD
"StatusDropdown"Dropdown with color indicators
"ReadOnly"Read-only text display
"ReadOnlyArray"Read-only array display
"ReadOnlyDateTime"Read-only date/time display
"ReadOnlyCumulativeNumber"Read-only cumulative number
"ReadOnlyRichText"Read-only rich text
"ReadOnlyWithButton"Read-only with action button
"ChoiceSet"Choice set / radio group
"FieldArray"Repeating field array