Skip to end of metadata
Go to start of metadata
General

Component Palette Icon:




Description

The Toggle Switch represents a bit: on (selected) or off (not selected). By default, when the switch is selected the color is blue. It is gray when it is not selected. Logically, this component is very similar to the Checkbox component.

This feature is new in Ignition version 8.1.2
Click here to check out the other new features

The Toggle Switch component has three pre-configured variants:

  • No Text - Default layout with no text.
  • Text Right - Layout with text on the right of the Toggle Switch.
  • Text Left - Layout with text on the left of the Toggle Switch.
Properties

Most Properties have binding options. For more information on Bindings, see Types of Bindings in Perspective.
This section only documents the Props Category of properties. The other Categories are described on the Perspective Component Properties page.

NameDescriptionProperty Type
selectedThe selected state of the Toggle Switch.value: boolean
label

Settings for the label for the Toggle Switch.

 Click to see the label properties
NameDescriptionProperty Type
textText for the Toggle Switch.string
positionText position relative to the Toggle Switch: right or left.value: boolean
style

Modify text style using the style properties. Full menu of style options is available for text, background, margin and padding, border, shape and miscellaneous. You can also specify a style class

object
object
color

Color settings for the Toggle Switch when it is selected and unselected.

 Click to see the color properties
NameDescriptionProperty Type
selectedColor of the Toggle Switch when selected (on). Can be chosen from color wheel, chosen from color palette, or entered as RGB or HSL value. See Color Selector.color
unselectedColor of the Toggle Switch when unselected (off). See Color Selector.color
object
enabled

Whether the user should be allowed to alter the Toggle Switch's selected state. Default is true.

Note: If the component is disabled, scripts can still run on the component. For example, if you add a script action to the onClick event, the script will fire when the user clicks on the Toggle Switch.

value: boolean
style

Sets a style for this component. Full menu of style options is available for text, background, margin and padding, border, shape and miscellaneous. You can also specify a style class

object

Perspective Component Events
The Perspective Event Types Reference page describes all the possible component event types for Perspective components. Not all component events support each Perspective component. The Component Events and Actions page shows how to configure events and actions on a Perspective component. Component scripting is handled separately and can be accessed from the Component menubar or by right clicking on the component.

Example

Image above shows both selected and deselected positions for the following properties.

PropertyValue
props.label.textOff / On
props.label.positionleft
props.color.selected#FF0000
props.color.unselected#8AFF8A



  • No labels