Field Config API Reference

Field Config API Reference

Complete reference for IFieldConfig, the primary type used to define forms as JSON configuration.


Complete Property Reference

PropertyTypeDefaultDescription
typestringundefinedUI component type key. Must match a registered component.
labelstringundefinedDisplay label for the field (required in v2).
requiredbooleanfalseWhether the field is required. Can be overridden by rules.
hiddenbooleanfalseWhether the field is hidden. Hidden fields skip validation.
readOnlybooleanfalseWhether the field is read-only.
disabledbooleanfalseWhether the field is disabled at the layout level.
defaultValueunknownundefinedDefault value when field is visible and value is null/undefined.
computedValuestringundefinedExpression or value function reference (e.g. "$values.qty * $values.price", "$fn.setDate()").
computeOnCreateOnlybooleanfalseIf true, computed value runs only during create (not edit).
confirmInputbooleanfalseTriggers confirmation modal before save when the field changes.
hideOnCreatebooleanfalseField not rendered in create mode.
skipLayoutReadOnlybooleanfalseIgnores layout-level disabled/readOnly override.
rulesIRule[]undefinedDeclarative dependency rules (when/then/else/priority).
validateIValidationRule[]undefinedValidation rules (unified: sync, async, cross-field, conditional).
optionsIOption[]undefinedStatic dropdown options.
loadOptions(ctx) => Promise<IOption[]>undefinedAsync options loader. When present, overrides static options. Cached per unique combination of optionsDependsOn values.
optionsDependsOnstring[]undefinedField IDs that trigger a re-run of loadOptions when they change. If omitted, loadOptions runs once on mount.
configRecord<string, unknown>undefinedArbitrary config passed to the field component.
itemsRecord<string, IFieldConfig>undefinedField array item definitions (FieldArray only).
minItemsnumberundefinedMinimum items in a field array.
maxItemsnumberundefinedMaximum items in a field array.
descriptionstringundefinedShort description shown as field tooltip or help text.
placeholderstringundefinedPlaceholder text for empty fields.
helpTextstringundefinedExtended help text (e.g. shown in a popover or below the field).

IOption Interface

interface IOption {
  value: string | number;
  label: string;
  disabled?: boolean;
  hidden?: boolean;
  selected?: boolean;
  title?: string;
  data?: unknown;
}

IFieldProps Interface

Props injected into every field component via React.cloneElement:

interface IFieldProps<T> {
  fieldName?: string;
  testId?: string;
  readOnly?: boolean;
  required?: boolean;
  error?: FieldError;
  saving?: boolean;
  value?: unknown;
  config?: T;
  options?: IOption[];
  label?: string;
  type?: string;
  setFieldValue?: (fieldName: string, fieldValue: unknown, skipSave?: boolean, timeout?: number) => void;
}

IRuntimeFieldState

After processing, each IFieldConfig becomes an IRuntimeFieldState at runtime:

PropertyTypeDescription
typestringUI component type (may be swapped by rules)
requiredbooleanWhether the field is required
hiddenbooleanWhether the field is hidden
readOnlybooleanWhether the field is read-only
validateIValidationRule[]Active validation rules
optionsIOption[]Currently available dropdown options
computedValuestringComputed value expression
dependentFieldsstring[]Fields that this field's value changes affect
dependsOnFieldsstring[]Fields whose values affect this field

Built-in Component Types

ComponentTypes (from packages/core/src/constants.ts) defines 28 keys: 21 editable + 6 read-only + 1 structural (FieldArray).

Editable

KeyConstantDescription
"Textbox"ComponentTypes.TextboxSingle-line text input
"Dropdown"ComponentTypes.DropdownSingle-select dropdown
"Toggle"ComponentTypes.ToggleBoolean toggle switch
"Number"ComponentTypes.NumberNumeric input
"Multiselect"ComponentTypes.MultiSelectMulti-select dropdown
"DateControl"ComponentTypes.DateControlDate picker
"Slider"ComponentTypes.SliderRange slider
"DynamicFragment"ComponentTypes.FragmentHidden fragment (form-state only, no visible UI)
"MultiSelectSearch"ComponentTypes.MultiSelectSearchMulti-select with search
"Textarea"ComponentTypes.TextareaMulti-line text input
"DocumentLinks"ComponentTypes.DocumentLinksURL link CRUD
"StatusDropdown"ComponentTypes.StatusDropdownDropdown with color indicators
"RadioGroup"ComponentTypes.RadioGroupSingle-select radio button group
"CheckboxGroup"ComponentTypes.CheckboxGroupMulti-select checkbox group (value: string[])
"Rating"ComponentTypes.RatingStar rating input (value: number)
"ColorPicker"ComponentTypes.ColorPickerNative color picker (value: hex string)
"Autocomplete"ComponentTypes.AutocompleteSearchable single-select with type-ahead
"FileUpload"ComponentTypes.FileUploadFile picker (single or multiple)
"DateRange"ComponentTypes.DateRangeTwo date inputs; value: { start, end } ISO strings
"DateTime"ComponentTypes.DateTimeCombined date+time input; value: ISO datetime-local string
"PhoneInput"ComponentTypes.PhoneInputPhone input with inline masking (us, international, raw)

Read-Only

KeyConstantDescription
"ReadOnly"ComponentTypes.ReadOnlyRead-only text display
"ReadOnlyArray"ComponentTypes.ReadOnlyArrayRead-only array display
"ReadOnlyDateTime"ComponentTypes.ReadOnlyDateTimeRead-only date/time
"ReadOnlyCumulativeNumber"ComponentTypes.ReadOnlyCumulativeNumberRead-only cumulative number
"ReadOnlyRichText"ComponentTypes.ReadOnlyRichTextRead-only rich text (sanitized HTML)
"ReadOnlyWithButton"ComponentTypes.ReadOnlyWithButtonRead-only text with an action button

Structural

KeyConstantDescription
"FieldArray"ComponentTypes.FieldArrayRepeating field array; configured via items/minItems/maxItems