Portal Community

Minimal Example

{
  "id": "config",
  "type": "json-editor",
  "label": "Configuration",
  "width": "full",
  "binding": {
    "source": "$json",
    "path": "node.config"
  }
}

Settings Reference

SettingTypeDefaultDescription
heightstring (CSS)"300px"Editor height. Use "auto" to grow with content.
minHeightstring (CSS)Minimum height when height: "auto"
maxHeightstring (CSS)Maximum height before scrolling when height: "auto"
schemaJSONSchema objectJSON Schema draft-07 for structural validation
modejson | textjsonEditor mode. text skips JSON parse validation.
readOnlybooleanfalseLock the editor from editing (syntax highlight only)
lineNumbersbooleantrueShow line numbers in the gutter
foldGutterbooleantrueShow collapse/expand arrows for objects and arrays
formatOnLoadbooleantrueAuto-format (pretty-print) the JSON when the form loads
tabSizenumber2Spaces per indent level

Stored Value Format

The JSON editor stores and returns a parsed JavaScript object/array — not a JSON string. When the editor content is invalid JSON, the field value is null and a parse error is shown:

// User types valid JSON: { "key": "value" }
// Stored value: { key: "value" }  ← JS object

// User types invalid JSON: { key: value }
// Stored value: null
// Error shown: "Invalid JSON: Unexpected token 'v'"

JSON Schema Validation

Provide a JSON Schema (draft-07) in settings.schema to validate the structure of the entered JSON beyond parse correctness:

{
  "id": "webhook-config",
  "type": "json-editor",
  "label": "Webhook Configuration",
  "width": "full",
  "settings": {
    "height": "250px",
    "schema": {
      "type": "object",
      "required": ["url", "events"],
      "properties": {
        "url": {
          "type": "string",
          "format": "uri",
          "description": "The webhook endpoint URL"
        },
        "events": {
          "type": "array",
          "items": { "type": "string" },
          "minItems": 1,
          "description": "List of event names to subscribe to"
        },
        "secret": {
          "type": "string",
          "description": "Optional HMAC signing secret"
        }
      },
      "additionalProperties": false
    }
  },
  "defaultValue": {
    "url": "https://",
    "events": ["form.submitted"]
  }
}

Auto-Height Mode

For forms where JSON content length varies greatly, use auto-height with bounds:

{
  "id": "metadata",
  "type": "json-editor",
  "label": "Metadata",
  "settings": {
    "height": "auto",
    "minHeight": "150px",
    "maxHeight": "600px",
    "formatOnLoad": true
  }
}

Read-Only Display

In view and preview modes, the JSON editor renders as a read-only syntax-highlighted code block. You can also force read-only in edit mode for display-only JSON fields:

{
  "id": "response-preview",
  "type": "json-editor",
  "label": "API Response",
  "settings": {
    "readOnly": true,
    "height": "200px",
    "lineNumbers": false,
    "foldGutter": true
  },
  "modeVisibilitySettings": {
    "edit": true,
    "view": true,
    "admin": true,
    "preview": false,
    "design": false
  }
}

Default Value

Provide a defaultValue as a JavaScript object (not a JSON string). Atlas Forms will pretty-print it when the editor initialises:

{
  "id": "node-settings",
  "type": "json-editor",
  "label": "Node Settings",
  "defaultValue": {
    "retryCount": 3,
    "timeoutMs": 5000,
    "headers": {}
  }
}

Common Use Cases

Use CaseConfiguration Notes
Workflow node configurationUse with JSON Schema for structured validation
API request body template400–600px height, foldGutter enabled
Debug / response viewerreadOnly: true, no validation
Settings overridesSmall height (200px), schema for known shape
Raw data inputmode: "text" to allow any text, not just valid JSON
Large JSON Performance The JSON editor is not designed for JSON documents larger than ~50KB. For large payloads, use a textarea control and parse manually in your submit handler. The editor's real-time parsing and syntax highlighting become slow above this threshold.