Toggle Switch
The Toggle Switch lets the operator turn a setting on or off. It is found in the Input - OpenBridge section of the Perspective Component Palette as Toggle Switch.

The Toggle Switch is one of the input components. How values are written back, events, disabling and the behavior in the Designer are shared by all of them and are described in Input Components — Common Features. This page covers what is specific to the Toggle Switch.
A Toggle Switch with default properties and label set to Toggle Switch:

A Toggle Switch dropped from the palette is off and has no label.
checked sets whether the switch is on:
Off (checked is false) |
On (checked is true) |
|---|---|
![]() |
![]() |
When the operator clicks the switch or its label, or presses Space while it
has focus, the new state is written to checked and then onActionPerformed
fires.
Bind checked bidirectionally to a tag to connect the switch to it. See
Values.
Properties
Section titled “Properties”| Name | Description | Property Type |
|---|---|---|
| checked | Whether the switch is on. Written when the operator clicks. Default false. |
value |
label is the text to the left of the switch. A click on the label toggles the
switch. Leave it empty for a switch without text:

Properties
Section titled “Properties”| Name | Description | Property Type |
|---|---|---|
| label | Text to the left of the switch. Empty by default. | value |
The Toggle Switch fills the width of its box: the label is at the left edge and the switch at the right edge. A label that does not fit on one line wraps. The blue frame is the component’s box:
| 160 px wide | 320 px wide |
|---|---|
![]() |
![]() |
The Toggle Switch is always 56 px high, whatever the height of its box. A new component is 48 px high, so the switch extends 8 px below its box:

Set the height to 56 px to make the box match what is drawn.
Disabled
Section titled “Disabled”| Off | On |
|---|---|
![]() |
![]() |
See Disabled.
Common Properties
Section titled “Common Properties”These work in the same way on every input component, and are described in Input Components — Common Features:
- Disabled —
disabled. - Appearance —
style.
Component Events
Section titled “Component Events”| Event | Description | Event Object |
|---|---|---|
| onActionPerformed | Fired when the operator toggles the switch, after checked is written. |
— |
See Events.
Examples
Section titled “Examples”Example 1 — Setting Bound to a Tag
Section titled “Example 1 — Setting Bound to a Tag”- Drop a Toggle Switch into the view, make it 200 px wide and 56 px high,
and set
labeltoAuto start. - Bind
checkedto the tag[default]Pump01/AutoStartand enable Bidirectional.
The switch now shows the tag value, and a click writes the new value to the tag.
Found an error or something unclear?
Tell us what is wrong, confusing or missing on this page.
Built on the OpenBridge Design System




