The Switch element is a toggle control used to turn an option on or off. It displays a label beside the toggle and supports customization of text color, style, size, and spacing. The Check field defines its default state when the page loads.
| Field Name | Type | Default Value | Description |
|---|---|---|---|
| Name | String | {name} | Unique identifier for the switch element. |
| Enable | Boolean | true | Determines if the switch is active or disabled. |
| Text | String | {text} | Label text displayed next to the switch. |
| Text.Color | Color | {textColor} | Color of the switch label text. |
| Text.Style | TextStyle | {textStyle} | Style of the switch label text (e.g., bold, italic). |
| Text.Size | Number | 16 | Font size of the label text. |
| Margin | Number | 20 | Outer spacing around the switch element. |
| MarginLine | Number | 10 | Vertical spacing relative to other elements. |
| Check | Boolean | false | Determines the default state of the switch (on/off). |
Coding:
{
"@Type": "Switch",
"Name": "{name}",
"Enable": true,
"Text": "{text}",
"Text.Color": "{textColor}",
"Text.Style": "{textStyle}",
"Text.Size": 16,
"Margin": 20,
"MarginLine": 10,
"Check": false
}
To see how to create this element in Applin Studio (no-code mode), visit:
Design the Switch in Applin Studio