Switch widget

The switch widget enables users to select one of two states, such as "On" and "Off."

Properties

Property

Description

Data type

active

Indicates whether to switch the default state.

Boolean

id

Unique identifier of this widget.

string

type Rich-media type, which is always Switch. string

Widget-specific expression evaluation

Property

Description

Data type

state

Example: #widget1.switch1.state

String

Code sample

var obj = {
    "widgetType": "form",
    "nodes":
    [{
            "id": "widget1",
            "controls": {
                "0": {
                    "type": "Switch",
                    "active": true,
                    "id": "switch1"
                }
            }
        }
    ]
}