Skip to content

Toggle Switch ui-switch

Adds a toggle switch to the user interface.

Properties

PropDynamicDescription
GroupDefines which group of the UI Dashboard this widget will render in.
SizeControls the width of the button with respect to the parent group. Maximum value is the width of the group.
LabelThe text shown within the button.
On PayloadThe type & value to output in msg.payload when the switch is turned on.
Off PayloadThe type & value to output in msg.payload when the switch is turned off.
On IconIf provided, this Material Design icon will replace the default switch when in "on" state. No need to include the mdi prefix.
Off IconIf provided, this Material Design icon will replace the default switch when in "off" state. No need to include the mdi prefix.
On ColorIf provided with a icons, this colour is used for the icon when in "on" state
Off ColorIf provided with a icons, this colour is used for the icon when in "off" state

Dynamic Properties

Dynamic properties are those that can be overriden at runtime by sending a particular msg to the node.

Where appropriate, the underlying values set within Node-RED will be overriden by the values set in the received messages.

PropPayloadStructures
Classmsg.classString

Example

Example of a Toggle SwitchExample of rendered switches in a Dashboard.