Toggle

Register on Lenra

Element of type Toggle

toggle

This component can be toggled on or off.

Examples

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

AttributeDescriptionType
typeThe type of the element.string ("toggle")
valueThe value of the element.boolean
autofocusThe default focus in boolean.boolean
disabledThe toggle is disabled if trueboolean
dragStartBehaviorDetermines the way that drag start behavior is handled.string ("start", "down")
nameThe name that will be used in the form.string
onPressedBasic Listener
splashRadiusThe splash radius when you click on the toggle.number
styleElement of type ToggleStyleToggleStyle