Begginer
2 MIN

Swap between interfaces with a Custom State

In this second episode of Tips & Tutorials, we will see how to swap between interfaces thanks to the intelligent use of a Custom State on Bubble.io.
Illustration Tips & Tutos Emvpee - Swap interfaces Custom State
Clement Ballion, expert Bubble.io & No code
Clément Ballion
Emvpee Founder & Bubble.io Expert.
Logo LinkedinPhone iconeMail icone

Custom States are temporary variables that allow us to create visual elements in our applications without having to do database changes.

In this second episode of Tips & Tutorials, we will see another use of Custom State: How to change the visual interface. For the demo, we will have 3 different interfaces: Documents, Products and Tasks.

→ Watch the first episode: How to animate a button with a custom state

1️⃣ Step 1: Building the Interfaces & General Design

→ Create a General group (as a Row) that will contain 2 other groups:

  • Left-group - for the Repeating group and the choice of clickable interface
  • Right group - which will itself contain the Custom State and the 3 interfaces

2️⃣ Step 2: Create an Option Set

→ Create an Option Set, rename it as ”Interface type“. Give it 3 options:

  • Documents
  • Products
  • Tasks

Capture Option Set interface

3️⃣ Step 3: The Repeating Group (RG)

Type of content :”Interface type“(the Option Set)

Data source : All Interface Type

Text inside the RG : Current Cell's Interface Type's Display

4️⃣ Step 4: The Custom State (CS)

→ Create a Custom State at the level of the Right Group. Rename it”Interface“, Type:”Interface type“ (the Option Set).

Default value : ”Documents

5️⃣ Step 5: Give a conditional value to your interface groups

For the example, we are simply going to explain the values to be entered for the interface “Documents”. If you have any doubts, refer to the video (2:51 min).

Layouts : Check Visible on page load + Collapse when Hidden

Conditional : When Group Right_CS's Interface is not Documents > This element is visible (TO UNCHECK)

In non-technical terms, Bubble is simply asked that when the Custom State of the Right Group is not set to”Documents“, we don't want the Documents interface to be visible.

We could also do it the other way around, but then we would have to uncheck Visible on page load“in the layouts.

Conditional capture of group documents

6️⃣ Step 6: Create the Workflow

Last step to make everything work, we now have to create our workflow to give the value we want to our Custom State and thus be able to navigate between our interfaces.

→ Add a Workflow on the text of the RG

Set State of an Element : Choose the group on the right (CS)

Custom State :”Interface

Value : Current cell's Interface Type

EMVPEE Banner

A project in mind?

We help you develop your Bubble.io application within 4 weeks.

  • 100% Customized design
  • API Integrations
  • Performance Optimisation
  • Training & Videos

Our latest Tips & Tutos

Find our latest Tips & Tutorials on Bubble and don't miss the next ones!

All Tips & Tutorials