Creating a Toggle in Thunkable X


You can create an on/off switch, also known as a toggle switch, in your app with a variety of different components and blocks in Thunkable X.


The switch component is probably the easiest to get started with.

When the switch is clicked, the value changes. The newValue variable is either true or false, depending on whether the switch is on or off.

In this example, a label is used to display the words “On” or “Off” depending on the position of the string.


Click to remix the “Toggl” app

Working with Times and Dates in Thunkable X


You can also combine buttons and variables to create a simple toggle like so:


In this example, in addition to changing the text on the button we also chance the value of the variable and the text colour in the button.

Click to remix the “Toggl” app


If you want an option that doesn’t use variables then you can simply use the text on the button to detect the current position of the button.


If you combined this approach with some “else if” conditions then you can easily create a switch with several different positions.

Click to remix the “Toggl” app


Expanding on the previous idea, you can toggle the background image of a component by doing something like this:


Click to remix the “Toggl” app

Can I Duplicate UI Components?