Toggle
This component can be toggled on or off.
Examples
toggle works like a button but with a boolean value.
Simple toggle
{
"type": "toggle",
// The value is stored in the app data
"value": data,
"onPressed": {
// This listener takes care of toggling the value of this toggle component.
"code": "toggle",
}
},
Properties
| Attribute | Description | Type |
|---|---|---|
| _type | The type of the element. |
|
| value | The value of the element. | boolean |
| autofocus | The default focus in boolean. | boolean |
| disabled | The toggle is disabled if true | boolean |
| dragStartBehavior | Determines the way that drag start behavior is handled. | string
|
| name | The name that will be used in the form. | string |
| onPressed | Listener | |
| splashRadius | The splash radius when you click on the toggle. | number |
| style | Element of type ToggleStyle | ToggleStyle |