Skip to content

Fields Properties

Every field exposes editable props (set during definition, mutable at runtime) and computed props (read-only values derived from field state).


Editable Props

Props you can define when creating fields and modify at runtime via field.set(prop, value).

Value & Display

PropertyTypeDefaultDescription
typestring"text"HTML input type (text, email, checkbox, file, number, etc.)
valueanyundefinedCurrent field value
initialanyundefinedInitial value on mount
defaultanyundefinedValue used when reset() is called
labelstring""Human-readable field label
placeholderstring""Placeholder text for the input
extraanynullArbitrary metadata (useful for select options, custom data)

Input Behavior

PropertyTypeDefaultDescription
disabledbooleanfalseField disabled state
deletedbooleanfalseSoft-deleted state (requires softDelete option)
nullablebooleanfalseAllow null as a field value
autoFocusbooleanfalseFocus this field on form initialization
inputModestringundefinedMobile keyboard mode: none, text, decimal, numeric, tel, search, email, url
autoCompletestringundefinedHTML autocomplete attribute
refReact RefundefinedReact ref, populated automatically when bind() is used

Validation

PropertyTypeDefaultDescription
rulesstringnullDVR validation rules (e.g. "required|email|min:6")
validatorsarraynullVJF validation functions
validatedWithstring"value"Field prop to validate instead of value (see validatedValue)
relatedstring[][]Other field paths to re-validate when this field changes

Converters & Computed

PropertyTypeDefaultDescription
converterfunctionidentityFunction controlling the value computed prop output
convertersfunction[]-Array of converter functions
inputfunctionidentityInput converter: maps user input to stored value
outputfunctionidentityOutput converter: maps stored value to output
computedfunctionundefinedDynamic value function: ({ form, field }) => value

Bindings & Options

PropertyTypeDefaultDescription
bindingsstring"default"Key of the registered binding template/rewriter to use
optionsobject{}Per-field Form Options, with fallback on global options
classclassundefinedCustom Field class (unified mode only, must extend Form.Field)
classesobjectundefinedCustom Field classes keyed by field path (separated mode only)

Events & MobX

PropertyTypeDefaultDescription
hooksobject{}Event hook functions
handlersobject{}Event handler functions
observersarraynullMobX observers on field props or fields map. Auto-loaded for dynamic arrays.
interceptorsarraynullMobX interceptors on field props or fields map. Auto-loaded for dynamic arrays.

Nested

PropertyTypeDefaultDescription
fieldsarrayundefinedNested sub-field definitions
namestringkeyOverrides the object key as field name (array syntax)

Computed Props

Read-only properties derived from the field state. Accessible at runtime (e.g. field.isValid, field.error).

Validation State

PropertyTypeMobXDescription
isValidbooleancomputedtrue if the field and all nested fields pass validation
hasErrorbooleancomputedtrue if the field or any nested field has errors
errorstringcomputedFirst error message (null if no error, null when showError is false)
errorSyncstringobservableSynchronous error message
errorAsyncstringobservableAsynchronous error message (from async validation)
validatingbooleancomputedtrue while validation is in progress
validatedintcomputedNumber of times the field has been validated

Identity & Structure

PropertyTypeMobXDescription
keystring-Field key (same as name if not provided)
namestring-Field name (same as key if not provided)
pathstring-Full field path (dot-notated for nested fields, e.g. "address.city")
sizeintcomputedNumber of child fields (0 for leaf fields)
idstring-Unique field ID (generated by uniqueId option)
hasNestedFieldsbooleancomputedtrue if the field contains nested sub-fields
hasIncrementalKeysbooleancomputedtrue if nested fields use incremental numeric keys

State & Interaction

PropertyTypeMobXDescription
focusedbooleancomputedtrue if the field is currently focused
blurredbooleancomputedtrue if the field has lost focus at least once
touchedbooleancomputedtrue if the field has been focused at least once
changedintcomputedNumber of times the field value has changed
submittingbooleancomputedtrue while the form/fieldset is submitting
submittedintcomputedNumber of times the fieldset has been submitted
actionRunningbooleancomputedtrue while a clear, reset, or submit action is in progress (useful for loading spinners)
resettingbooleanobservabletrue while the field is being reset
clearingbooleanobservabletrue while the field is being cleared

Value Comparison

PropertyTypeMobXDescription
isDirtybooleancomputedtrue if the current value differs from the initial value
isPristinebooleancomputedtrue if the current value equals the initial value
isDefaultbooleancomputedtrue if the current value equals the default value
isEmptybooleancomputedtrue if the field value is empty (delegates to child fields for nested fields)

Special

PropertyTypeMobXDescription
checkedanycomputedCurrent value when type is "checkbox"; undefined otherwise
validatedValueanycomputedValue of the field prop specified by validatedWith (default: "value")
filesanyobservableFile data populated by onDrop event handler for type: "file" fields
showErrorbooleanobservableControls whether error messages are visible
validationErrorStackstring[]observableStack of validation error messages

Occurrence Strategy

Some computed props use different aggregation strategies when checking nested fields:

PropertyStrategyMeaning
isValid, isPristine, isDefault, isEmptyeveryMust be true for ALL nested fields
hasError, isDirty, focused, blurred, touchedsometrue if ANY nested field is true

Released under the MIT License.