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
| Property | Type | Default | Description |
|---|
type | string | undefined | UI component type key. Must match a registered component. |
label | string | undefined | Display label for the field (required in v2). |
required | boolean | false | Whether the field is required. Can be overridden by rules. |
hidden | boolean | false | Whether the field is hidden. Hidden fields skip validation. |
readOnly | boolean | false | Whether the field is read-only. |
disabled | boolean | false | Whether the field is disabled at the layout level. |
defaultValue | unknown | undefined | Default value when field is visible and value is null/undefined. |
computedValue | string | undefined | Expression or value function reference (e.g. "$values.qty * $values.price", "$fn.setDate()"). |
computeOnCreateOnly | boolean | false | If true, computed value runs only during create (not edit). |
confirmInput | boolean | false | Triggers confirmation modal before save when the field changes. |
hideOnCreate | boolean | false | Field not rendered in create mode. |
skipLayoutReadOnly | boolean | false | Ignores layout-level disabled/readOnly override. |
rules | IRule[] | undefined | Declarative dependency rules (when/then/else/priority). |
validate | IValidationRule[] | undefined | Validation rules (unified: sync, async, cross-field, conditional). |
options | IOption[] | undefined | Static dropdown options. |
loadOptions | (ctx) => Promise<IOption[]> | undefined | Async options loader. When present, overrides static options. Cached per unique combination of optionsDependsOn values. |
optionsDependsOn | string[] | undefined | Field IDs that trigger a re-run of loadOptions when they change. If omitted, loadOptions runs once on mount. |
config | Record<string, unknown> | undefined | Arbitrary config passed to the field component. |
items | Record<string, IFieldConfig> | undefined | Field array item definitions (FieldArray only). |
minItems | number | undefined | Minimum items in a field array. |
maxItems | number | undefined | Maximum items in a field array. |
description | string | undefined | Short description shown as field tooltip or help text. |
placeholder | string | undefined | Placeholder text for empty fields. |
helpText | string | undefined | Extended 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:
| Property | Type | Description |
|---|
type | string | UI component type (may be swapped by rules) |
required | boolean | Whether the field is required |
hidden | boolean | Whether the field is hidden |
readOnly | boolean | Whether the field is read-only |
validate | IValidationRule[] | Active validation rules |
options | IOption[] | Currently available dropdown options |
computedValue | string | Computed value expression |
dependentFields | string[] | Fields that this field's value changes affect |
dependsOnFields | string[] | 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
| Key | Constant | Description |
|---|
"Textbox" | ComponentTypes.Textbox | Single-line text input |
"Dropdown" | ComponentTypes.Dropdown | Single-select dropdown |
"Toggle" | ComponentTypes.Toggle | Boolean toggle switch |
"Number" | ComponentTypes.Number | Numeric input |
"Multiselect" | ComponentTypes.MultiSelect | Multi-select dropdown |
"DateControl" | ComponentTypes.DateControl | Date picker |
"Slider" | ComponentTypes.Slider | Range slider |
"DynamicFragment" | ComponentTypes.Fragment | Hidden fragment (form-state only, no visible UI) |
"MultiSelectSearch" | ComponentTypes.MultiSelectSearch | Multi-select with search |
"Textarea" | ComponentTypes.Textarea | Multi-line text input |
"DocumentLinks" | ComponentTypes.DocumentLinks | URL link CRUD |
"StatusDropdown" | ComponentTypes.StatusDropdown | Dropdown with color indicators |
"RadioGroup" | ComponentTypes.RadioGroup | Single-select radio button group |
"CheckboxGroup" | ComponentTypes.CheckboxGroup | Multi-select checkbox group (value: string[]) |
"Rating" | ComponentTypes.Rating | Star rating input (value: number) |
"ColorPicker" | ComponentTypes.ColorPicker | Native color picker (value: hex string) |
"Autocomplete" | ComponentTypes.Autocomplete | Searchable single-select with type-ahead |
"FileUpload" | ComponentTypes.FileUpload | File picker (single or multiple) |
"DateRange" | ComponentTypes.DateRange | Two date inputs; value: { start, end } ISO strings |
"DateTime" | ComponentTypes.DateTime | Combined date+time input; value: ISO datetime-local string |
"PhoneInput" | ComponentTypes.PhoneInput | Phone input with inline masking (us, international, raw) |
Read-Only
| Key | Constant | Description |
|---|
"ReadOnly" | ComponentTypes.ReadOnly | Read-only text display |
"ReadOnlyArray" | ComponentTypes.ReadOnlyArray | Read-only array display |
"ReadOnlyDateTime" | ComponentTypes.ReadOnlyDateTime | Read-only date/time |
"ReadOnlyCumulativeNumber" | ComponentTypes.ReadOnlyCumulativeNumber | Read-only cumulative number |
"ReadOnlyRichText" | ComponentTypes.ReadOnlyRichText | Read-only rich text (sanitized HTML) |
"ReadOnlyWithButton" | ComponentTypes.ReadOnlyWithButton | Read-only text with an action button |
Structural
| Key | Constant | Description |
|---|
"FieldArray" | ComponentTypes.FieldArray | Repeating field array; configured via items/minItems/maxItems |