The toggle Element

The toggle element defines a single element which can be set to either on or off.

{
    "type": "toggle",
    "tags": array<string>,
    "version": string,
    "key": string,
    "label": string,
    "selected": boolean,
    "validator": {
        "required": ?boolean
    }
}

The label Property

since v1.0.0

The label property represents a caption for the toggle element.

The selected Property

since v1.0.0

The selected property sets the initial state of the toggle element.

The validator Property

The validator property may contain the required rule for the toggle element to be validated against.

If validator.required is set to true, then the toggle element's value also has to be true to be valid.

The returned value of the toggle element

since v1.0.0

The value of the element is either true or false. It cannot be empty.

Possible values for tags

  • ACCEPT

Example of a possible look of a toggle element with the ACCEPT tag

Example of a possible look of a toggle element with the ACCEPT tag.

  • SETTINGS

Example of a possible look of a toggle element with the SETTINGS tag

Example of a possible look of a toggle element with the SETTINGS tag.

Example

{
    "type":"toggle",
    "tags":[
        "ACCEPT"
    ],
    "key":"toggle1",
    "version":"1.0.0",
    "label":"Accept",
    "selected":false
}

Changelog


1.0.0 - 01.02.2019

  • initial version

results matching ""

    No results matching ""