Select

select control empty

Schema

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Select",
  "description": "config for editor select control",
  "type": "object",
  "required": [
    "option"
  ],
  "properties": {
    "control": {
      "const": "select"
    },
    "value": {
      "type": [
        "string",
        "number",
        "null"
      ],
      "description": "Value of the selected option"
    },
    "options": {
      "type": "array",
      "description": "A collection of items to be rendered for a select component",
      "items": {
        "type": "object",
        "description": "A label-value pair to be rendered for a select option",
        "required": [
          "label",
          "value"
        ],
        "properties": {
          "label": {
            "type": "string",
            "description": "Label of a select option",
            "examples": [
              "Large"
            ]
          },
          "value": {
            "type": "string, number, null",
            "description": "Value of a select option",
            "examples": [
              "large",
              2
            ]
          }
        }
      }
    },
    "placeholder": {
      "type": "string",
      "description": "A placeholder text to be shown for no-selection default"
    }
  }
}

Example

select control filled

 {
  "control": "select",
  "label": "Select",
  "options": [
    {
      "label": "option1",
      "value": "choice1"
    },
    {
      "label": "option2",
      "value": "choice2"
    }
  ],
  "value": "choice1"
}