Switch

The Switch widget allows users to turn on or off any setting in your app. For example, you could use it on a settings page to enable/disable push notifications, location services, etc.

Adding Switch

To add a Switch widget, select the Switch widget from the Add Widget Button or add it directly from the widget tree.

Switch Initial Value

You might want to show the switch with a default status, i.e., ON or OFF. For example, showing the notification setting with a default switch OFF.

To set the initial value:

  1. Select the Switch widget, move to the properties panel, and see the Switch Initial Value property.

  2. Use the toggle button to set this value manually, or click Variable Icon to set it based on the value from API Calls. If you choose Set from Variable, ensure you pass the boolean value from the source (e.g., API response).

Is Switch Enabled?

If for some reason, you want to display the Switch but not save its action, then you can turn this toggle to OFF. This will ensure that no action takes place when the Switch is disabled.

Active Color

Change the Color of the Switch when it is Toggled On.

Inactive Thumb Color

You can change the Color used for the thumb area of the Switch when the Switch is in off state.

Active Track Color

This is the Color used for the track area of the switch when the switch is on. The track area is the horizontal bar that appears behind the thumb.

Inactive Track Color

This is the Color used for the track area of the switch when the switch is off. The track area is the horizontal bar that appears behind the thumb.

Last updated