Schema Options

Options in schemas are always prefixed with x- (e.g. x-assertFormat) to not collide with future JSON schema spec keywords.

x-addPropertyContent

Type: boolean

Text content for "add property" buttons.

x-arrayAdd

Type: boolean

Default: true

If array "add" buttons should be displayed.

x-arrayAddContent

Type: boolean

Text content for array "add" buttons.

x-arrayButtonsPosition

Type: string

Default: 'left'

Options: 'left', 'right'

Controls the positioning of action buttons (delete, move, drag) in table format arrays. When set to 'right', buttons appear on the right side of the table. When set to 'left' (default), buttons appear on the left side.

x-arrayDelete

Type: boolean

Default: true

If array "delete" buttons should be displayed.

x-arrayDeleteAll

Type: boolean

Default: false

Adds a "Delete all items" button to the array editor's header actions area.

x-arrayDeleteAllContent

Type: string

Text content for the "delete all" button.

x-arrayDeleteConfirm

Type: boolean

Per-schema override for showing a confirmation dialog before deleting array items. Overrides the global arrayDeleteConfirm option.

x-arrayDeleteContent

Type: boolean

Text content for array "delete" buttons.

x-arrayDragContent

Type: boolean

Text content for array "drag" buttons.

x-arrayFooterAdd

Type: boolean

Default: false

Adds an "Add item" button in the footer of the array editor.

x-arrayFooterAddContent

Type: string

Text content for the footer "add" button.

x-arrayFooterButtonsPosition

Type: string

Default: 'right'

Options: 'left', 'right'

Controls the alignment of footer buttons. When 'right', buttons are pushed to the right side of the footer. When 'left', buttons align to the left.

x-arrayFooterDeleteAll

Type: boolean

Default: false

Adds a "Delete all items" button in the footer of the array editor.

x-arrayFooterDeleteAllContent

Type: string

Text content for the footer "delete all" button.

x-arrayMove

Type: boolean

Default: true

If array "move up" and "move down" buttons should be displayed.

x-arrayMoveDownContent

Type: boolean

Text content for array "move down" buttons.

x-arrayMoveUpContent

Type: boolean

Text content for array "move up" buttons.

x-assertFormat

Type: boolean

Default: false

Treats "format" as a validator rather than just an annotation.

x-collapseToggleContent

Type: boolean

Text content for "collapse" buttons.

x-categoryOrder

Type: string[]

Controls the display order of tabs in categories-format object editors (categories-vertical, categories-horizontal). Categories listed in the array appear first in the specified order; any categories not listed follow in their natural order.

x-containerAttributes

Type: object

Editors container HTML attributes can be set using this option. Attributes such as class or data-* will be applied to the container element.

{
  "type": "object",
  "x-containerAttributes": {
    "class": "my-editor",
    "data-id": "user-form"
  }
}

x-deactivateNonRequired

Type: boolean

Whether the editor should deactivate (hide) or activate (show) non required properties. Works only with object type editors.

x-discriminator

Type: string | object

When set on a oneOf or anyOf schema, determines the active sub-schema by validating the specified property against each schema option. Accepts either a property name string or an object with a propertyName key.

Falls back to the standard error-counting algorithm if no discriminator match is found.

{
  "oneOf": [
    {
      "type": "object",
      "properties": {
        "type": { "type": "string", "const": "cat" },
        "name": { "type": "string" }
      }
    },
    {
      "type": "object",
      "properties": {
        "type": { "type": "string", "const": "dog" },
        "breed": { "type": "string" }
      }
    }
  ],
  "x-discriminator": "type"
}

x-editJsonData

Type: boolean

Default: false

Enables inline JSON editing mode for this specific schema, allowing users to directly edit the JSON data within form fields.

{
  "x-editJsonData": true,
  "type": "object",
  "title": "Edit JSON Data",
  "description": "This object has 'x-editJsonData: true' which enables inline JSON editing.",
  "properties": {
    "name": {
      "type": "string",
      "title": "Name"
    },
    "description": {
      "type": "string",
      "title": "Description"
    }
  }
}

x-embedSwitcher

Type: boolean

Default: false

When enabled on a oneOf or anyOf schema, embeds the type switcher inside the selected editor's header rather than displaying it above.

x-enableCollapseToggle

Type: boolean

Display a collapse button used to collapse or expand editors that support collapse like object and arrays.

x-enforceConst

Type: boolean

Default: true

Value will remain whatever is defined in schema "const".

x-enforceEnum

Type: boolean

Default: true

Whether the editor initial value will be the first item in the "enum".

x-enumTitles

Type: string[]

Used to display user-friendly labels in the editor instead of those listed in "enum".

{
  "type": "string",
  "enum": ["us", "gb", "de"],
  "x-enumTitles": ["United States", "United Kingdom", "Germany"]
}

x-format

Type: string

Determines which editor UI will be used to edit the json instance.

x-grid

Type: object

A configuration object to determine the position of the property editor in the parent's grid.

Options:

  • columns: How many columns should the editor occupy. The number of columns can vary between css frameworks and their configuration.
  • offset: How many columns should the editor be offsetted
  • newRow: Whether the editor should be put in a new row
{
  "type": "object",
  "x-format": "grid",
  "properties": {
    "firstName": {
      "type": "string",
      "x-grid": { "columns": 6 }
    },
    "lastName": {
      "type": "string",
      "x-grid": { "columns": 6 }
    }
  }
}

x-hidden

Type: boolean

Editors can be hidden using this option. When set to true, the editor is hidden.

x-info

Type: object

Used to display extra information.

Options:

  • variant: "modal"
  • title: Plain text or markdown
  • content: Plain text or markdown
{
  "type": "string",
  "x-info": {
    "variant": "modal",
    "title": "Help",
    "content": "Enter your full legal name."
  }
}

x-inputAttributes

Type: object

Used to set attributes for the editor input if it has one.

{
  "type": "string",
  "x-inputAttributes": {
    "placeholder": "Enter your name",
    "autocomplete": "name"
  }
}

x-messages

Type: object | string[]

Validation error messages can be customized using this option in the schema. The option can be used in different ways:

Array format

Pass messages as an array of strings:

{
  "type": "string",
  "minLength": 5,
  "x-messages": [
    "5 chars please."
  ]
}

Object format with validation keywords

Pass messages as an object with validation keywords as keys:

{
  "type": "string",
  "minLength": 5,
  "const": "locoloco",
  "x-messages": {
    "minLength": "Need at least 5 sparks of brilliance.",
    "const": "Only 'locoloco' unlocks the magic here."
  }
}

Internationalization format

Pass messages with language codes for internationalization support:

{
  "type": "string",
  "minLength": 5,
  "const": "locoloco",
  "x-messages": {
    "en": {
      "minLength": "Need at least 5 sparks of brilliance.",
      "const": "Only 'locoloco' unlocks the magic here."
    }
  }
}

x-objectAdd

Type: boolean

Default: true

Per-schema override for showing or hiding the "Add property" button on object editors. Overrides the global objectAdd option.

x-navWarning

Type: boolean

Default: true

When enabled, displays a warning icon (⚠) in the legend of array and object editors when they contain nested validation errors. Set to false to disable.

x-navWarningMessage

Type: string

Custom tooltip message displayed on the legend warning icon. Requires x-navWarning to be active.

x-propertiesToggleContent

Type: boolean

Text content for "properties" buttons.

x-propGroup

Type: string

Assigns a property to a named group in the properties activation dialog. Used together with enablePropertiesToggle and x-propGroupOrder.

x-propGroupOrder

Type: string[]

Defines the display order of property groups in the properties activation dialog. Groups are defined using x-propGroup on individual properties. Groups not included in the array are appended at the end; the default group (properties without x-propGroup) always appears first.

{
  "type": "object",
  "x-propGroupOrder": ["personal", "contact"],
  "properties": {
    "name": { "type": "string", "x-propGroup": "personal" },
    "age": { "type": "number", "x-propGroup": "personal" },
    "email": { "type": "string", "x-propGroup": "contact" }
  }
}

x-showErrors

Type: string

Default: "change"

Options: "never", "change", "input", "always"

Determines when to display validation errors for this specific schema. Overrides the instance-level showErrors setting.

Note: The "input" option provides real-time validation as the user types, but only affects text-based inputs (string inputs, textareas, number inputs).

x-sortable

Type: boolean

Default: false

Items can be sorted via drag and drop if Sortable.js is available.

x-startCollapsed

Type: boolean

Whether the editor should start expanded or collapsed. Works on editors that support collapse like object and arrays.

x-subErrors

Type: boolean

Per-schema override for including sub-error details in validation errors. Overrides the global subErrors option.

x-switcherTitle

Type: string

Default: property name or "title"

The text displayed in the multiple editor switcher to select this sub-schema editor.

x-titleHidden

Type: boolean

Default: false

Hides the editor title.

x-titleIconClass

Type: string

Icon class to use in titles if using any.

x-titleTemplate

Type: string

A template to form titles dynamically.

x-useConstraintAttributes

Type: boolean

Per-schema override for applying native HTML constraint attributes based on JSON Schema keywords. Overrides the global useConstraintAttributes option.

  • Number inputs: min, max
  • Number range: min, max
  • String inputs: minlength, maxlength, pattern
  • Textarea: minlength, maxlength