Switch - AppDaddy-Software-Solutions-Inc/framework-markup-language GitHub Wiki

<SWITCH/> : FormField

The <SWITCH/> is a really simple animated switch button that holds a true/false value.

Restrictions:

  • Do not use a <SWITCH/> where by default the value should be null
  • <SWITCH/> can only have a true/false state

Attributes

Name Type Default Description Req
value bool false defaults to false if not set in template, true shows an on switch, false shows an off switch
color The color of the switch when "false". Can be specified as a comma separated list (color, color2, color3)
color2 color The color of the switch when "true".
color3 color The color of the switch track.

Example

<BOX layout="row" center="true" expand="false">
	<SWITCH id="sw" />
	<TEXT size="28" value="={sw} ? ':hear_no_evil:' : ':see_no_evil:'" />
</BOX> 

Bind to the value directly by the id sw or do sw.value to determine the SWITCH's current bool value.

Off On

logo See it in Action

Other Widgets You May Find Useful:

⚠️ **GitHub.com Fallback** ⚠️