You can configure a menu to show the hierarchical structure of controls. Level-1 and level-2 menus are supported.

Menu styles

  • Level-1 menuLevel-1 menu
  • Level-2 menuLevel-2 menu

Description

Field name Element Type Required Remarks
name The name of the control. string Yes No default value.
type Type string Yes No default value.
default Default value object No If this field is not specified, it is left empty.
children The menu content. object No The default value is {}. The mode and name fields must be configured.
  • mode: whether a level-2 menu is configured. If you set this field to single, a level-1 menu is configured. If you set this field to multiple, a level-2 menu is configured.
  • name: the name of the menu.

Values

Condition Data type Examples Default value
N/A object
"options": {
   "menuA": {
     "switch": true
   },
   "menuB": {
     "menuB1": {
       "text": "Hello"
     },
     "menuB2": {
       "stepper": 2
     }
   }
 }
{}

Sample configuration

Configuration example of a menu
"options": {
    "name": "Menu",
    "type": "menu",
    "children": {
      "menuA": {
        "name": "Menu A",
        "mode": "single",
        "children": {
          "switch": {
            "name": "Switch",
            "type": "switch",
            "default": true
          }
        }
      },
      "menuB": {
        "name": "Menu B",
        "mode": "multiple",
        "children": {
          "menuB1": {
            "name": "Menu B1",
            "children": {
              "text": {
                "name": "Text",
                "type": "text",
                "default": "Hello"
              }
            }
          },
          "menuB2": {
            "name": "Menu B2",
            "children": {
              "stepper": {
                "name": "Stepper",
                "type": "stepper",
                "default": 1
              }
            }
          }
        }
      }
    }
}