Skip to content
You're viewing documentation for Draftbit Classic (v1), our previous platform. See the current Draftbit docs.

Switch

A basic switch that can be toggled between a selected and unselected state, return a boolean (true or false) value.

Style properties allow you to customize the look and feel of the component. Combinations of styles applied to components can be saved as Stylesheets to easily reuse styles throughout your app. Styles can also be set dynamically using Variables. To learn more about all the different styling properties and how they work, take a look at Intro to Styling.

PropertyDescription
Active Track ColorSet the color of the Switch component when its value is true.
Inactive Track ColorSet the color of the Switch component when its value is false.
Active Thumb ColorSet the color of the thumb when the component value is true.
Inactive Thumb ColorSet the color of the thumb when the component value is false.
PropertyDescription
Component nameTo alter the name of the component. The name is reflected in the Components tree. Defaults to Switch.
PropertyDescription
DisabledRemove toggle functionality, gray out the switch, and sets it as unselected. You can also initialize it by a boolean value from a data source. Accepted values: true or false.
Data SourceInitialize the stateful component with a value from a data source.

You can conditionally display a component based on a given condition. Learn more about conditionally displaying components in the Conditional Display doc.

Trigger nameDescription
On Value ChangeRuns the Actions when the value changes