dynamic-forms / Interface

LogicConfig

Configuration for conditional field logic.

Defines how field behavior changes based on conditions. Supports hiding, disabling, making readonly, or requiring fields based on form state or field values.

Properties

NameTypeDescription
condition
boolean | ConditionalExpression | FormStateCondition

Condition that determines when this logic applies.

Can be:

Example usage
// Static condition
condition: true

// Field value condition
condition: {
  type: 'fieldValue',
  fieldPath: 'status',
  operator: 'equals',
  value: 'locked'
}

// Form state condition (for buttons)
condition: 'formSubmitting'
type
"disabled" | "readonly" | "hidden" | "required"

Logic type identifier.

  • hidden: Hide the field from view (still participates in form state)
  • readonly: Make the field read-only
  • disabled: Disable user interaction
  • required: Make the field required

Example usage

// Hide email field when contact method is not email
{
  type: 'hidden',
  condition: {
    type: 'fieldValue',
    fieldPath: 'contactMethod',
    operator: 'notEquals',
    value: 'email'
  }
}

// Disable button when form is submitting
{
  type: 'disabled',
  condition: 'formSubmitting'
}