Home

Guides

Editor

Components

Actions

Conditions

Components

Basic

Container

Text

Image

Icon

Button

Forms

Local State

Text Input

Date Picker

Logic

Conditional Logic

Conditional Switch Logic

Modal

Sheet

Pager

Tabbed Pager

Data

Data Loader

Repeating Item

Countdown Timer

Data Transformer

Date Elements

Paging Data Loader

Contentful

Rich Text

Conditional Switch Logic Component Documentation

Overview

The Conditional Switch Logic Component allows you to define multiple conditions and branch your app's behavior accordingly. Unlike simple if/then logic, this component enables switching between various predefined outcomes based on different conditions. It is useful for handling scenarios where two possible outcomes are needed.


Key Features

  • If/Then/Else Logic

  • Streamlined Decision-Making

  • Default Fallback Option


Component Fields

1. Condition

2. Content A

3. Content B

Preview

4. Show in preview


Best Practices for Using the Conditional Switch Logic Component

  • Prioritise Conditions:Arrange your conditions in order of importance, as the first true condition will trigger its corresponding outcome.

  • Use a Fallback Condition:Always define a fallback (default) case to ensure your app behaves predictably if none of the conditions match.

  • Test All Paths:Test each possible condition and outcome to make sure all paths are functioning as expected, especially if complex logic is involved.