Skip to content

Components JSON Schema

Mike edited this page May 29, 2025 · 20 revisions

Every component that can be rendered within a form also adheres to a JSON schema definition used to describe how that component behaves within the form. Every component that is rendered within a form shares a common schema that is used to represent the component as it is rendered within the form. Here are the common parameters that all components share.

For the updated documentation on available component settings, refer to the Form.io User Guide Section "Component Settings"

Common Parameters

PropertyDescriptionValueRequiredDefault
typeThe type of componentaddressyesaddress
keyThe API key for this field.any stringyes
labelThe HTML label to give this componentany stringno
placeholderThe text to show in the input before they type.any stringno
inputDetermines if this is an input from the user.true or falseyestrue
tableViewDetermines if this field will show in the data tables output.true or falsenotrue
multipleIf this field should collect multiple values, creating an array of values.true or falsenofalse
protectedIf the value of this field should be shown to the end user via API once it is saved.true or falsenofalse
prefixThe prefix text to put in front of the inputAny stringno
suffixThe suffix text to put after the inputAny stringno
defaultValueThe default value to provide to this component.Depends based on the componentno
clearOnHideIf the value of this field should be cleared when it is conditionally hidden.true or falsenotrue
uniqueValidates if this field should be unique amongst other submissions in the same form.true or falsenofalse
persistentDetermines if the value of this field should be saved as persistent.true or falsenotrue
hiddenDetermines if this field should be hidden from view by default. This can be overridden with the conditionals.true or falsenofalse
validateDetermines validation criteria for this componentObject with the following properties.
  • required - If the field is required
  • minLength - For text input, this checks the minimum length of text for valid input
  • maxLength - For text inputs, this checks the maximum length of text for valid input
  • pattern - For text input, this checks the text agains a Regular expression pattern.
  • custom - A custom javascript based validation or a JSON object for using JSON Logic
no{required: false}
conditionalDetermines when this component should be added to the form for both processing and input.Object with the following properties.
  • show - If the field should show if the condition is true
  • when - The field API key that it should compare its value against to determine if the condition is triggered.
  • eq - The value that should be checked against the comparison component
  • json - The JSON Logic to determine if this component is conditionally available.
no
errorsAllows customizable errors to be displayed for each component when an error occurs. This is an object with the following keys
  • required
  • min
  • max
  • minLength
  • maxLength
  • invalid_email
  • invalid_date
  • pattern
  • custom
An object where the keys are provided in previous cell, and the values are the strings you wish to display. Each string has the {{ field }} to use within the string. Example.
{"required": "{{ field }} is required. Try again."}
no
logicAllows changing the component definition in reaction to data entered in a form. For example, changing a field to required, disabled or hidden when a value is entered.An array of instances of the Field Logic Schemano

Below is a list of all Form Components and the JSON schema specification for each component. The following components are allowed.

Clone this wiki locally