Switch
An on/off toggle exposing a boolean. Bound to a writable boolean tag it is the most direct control on a screen.


Reach for it when you need:
- Enable/disable a function
- A boolean field inside a Form
Component name: Switch · Category: Input
In the palette: On/off toggle (exposes a boolean value)
Properties
Any property can be bound to a tag, another component's property, or a query.
| Property | Type | Default | Description |
|---|---|---|---|
value | boolean | false | The toggle state — reflects what the user sets, and bindable. |
title | string | Switch | — |
showTitle | boolean | true | — |
titleSize | number | 13 | — |
titlePosition | enum | top | Where the title sits relative to the switch: above (top), or inline to its left / right. Options: top · left · right. |
disabled | boolean | false | — |
style | style | {} | Custom CSS properties |
Events
Attach event actions to these in the Event Manager.
| Event | Label | Group | Payload |
|---|---|---|---|
click | Click | Mouse | The DOM event. |
dblclick | Double click | Mouse | The DOM event. |
contextmenu | Right click | Mouse | The DOM event. |
mouseenter | Mouse enter | Mouse | The DOM event. |
mouseleave | Mouse leave | Mouse | The DOM event. |
change | Change | Input | The DOM event. |
submit | Submit | Input | The DOM event. |
focus | Focus | Input | The DOM event. |
blur | Blur | Input | The DOM event. |
contextmenu fires your configured actions at runtime only — in LiveView and in preview. On the Designer canvas the right-click is captured to open the Event Manager, so testing it there will not run your actions. Test right-click in preview.
Notes
A switch bound straight to a plant tag writes on every flick. For anything consequential, bind it to a client variable and write through a confirmed script action instead.