How to display text when component is click?

Hi all, I have created the following interaction so far. Once the user clicks “4”, the component changes to the variant with the square around it to show that “4” has been selected.

Here is what I would like to do now: Only when “4” is clicked (and the square around it shows), the text layer with the text "Monday 4th March, 2024) shows below the calendar.

Would anyone be able to tell me how I can do this? Any help would be much appreciated :slight_smile:

Hi @Jenny_Chantratita

You may achieve this using variables.

  1. Create a new String Variable (e.g: fullDate) set to an empty value (like a space)

  2. Bind fullDate to the textbox after “Date Selected:” using the hexagon on the Design panel near the text options

  3. On the click interaction of “4” add a Set variables on top. Set fullDate to your desired text (i.e: Monday, 4th March, 2024), and then go to the next view
    image

Let me know if it helped

1 Like

Hi @Haroll! This is super helpful. Thank you so much! It worked for me :slight_smile:

One more question, this works well for me. However, I haven’t 100% got the interaction I wanted. On the click interaction with 4, it changes to 4 with the square border around it. I then have to click it again to show “Monday 4th March 2024”.

Is there anyway that I can do the click interaction with 4 for the first time and for it to change to 4 with a square and show the date at the same time?

Yes, you can add multiple action in one interaction using the + icon, located top right, on the interaction modal to add
image


in the image below, I first set a variable and then navigate to another view

Hi @Haroll thanks for your help! How would I get the “calendar 4th selected”?

I’m sorry I illustrate an interaction between two frame while you were looking for a interaction between variant. What you need to use is a Change to action

I have created the following interaction so far. Once the user clicks “4”, the component changes to the variant

Basically use the same interaction and prepend it with the set variable for the date,


On the screen above : date selected represent the property name, and 4 a variant of the component.

Thank you so much! You’ve been super helpful :slight_smile:

1 Like