Simple Container with switchable content (views)?

Hi,
I am amazed how fast and intuitive weweb is. Can’t believe how you managed to achieve this performance. Genius!
I come from retool which has one very nice component. The Container has views where you can put different content and also add animations to switch the content. That thing is really missing or I haven’t found it.

  • I saw the tabs container which is good, but i found no way to hide the tabs as I just want to control the views with workflows/scripts.
  • I am aware of building it with variables and show/hide of components but it would not be intuitive or fast

So is there an easy way to switch the content of a container?

Best,

Chris

1 Like

Make an array of objects with your data (slides/views) then just access it by indexes. Like for example the first slide would be [0], the other would be [1] and so on. You can bind the number to a variable, and add buttons to control this.

Thank you! But I want to design and style each view differently and with different components. Your idea just manages the data but not the visual representation or not?

You can display whatever you want depending on the index you’re on. For example if you have 7 templates, then you show each of them at a specific index with conditional rendering/some other way. I did this with the method I’m describing. It’s a slider, with dynamic data displayed on different screens.

wow thank you!

Can you control via Script which slide is active? How did you do that? Found no action inside the slides component…

I built this myself actually, it’s a div where the slides change based on the current index, I’m not sure how to do this in Tabs. It would be very long to explain, but I’m gonna post this kind of stuff on the Marketplace once it’s ready though) It’s doable with States and NoCode actions in the workflows tho, so possible in WeWeb.

Oh yes please. This looks very well done… and unique in weweb

1 Like

You used also the transform as it seems… do you also hide/unrender the not visible screens after the motion to improve performance or is this not even necessary ?

Not really, there weren’t that many of the slides.