Show/hide vs toggle vs custom state

Hi!

I’m very curious when to use one or the other. When should you use which action?

Example: I want to show a list of things (products) in a repeating group in a sidebar/menu. When a user clicks an icon, the rg will show or hide. (optional) When another icon is pressed, it will hide it the rg.

Anyone mind to give some insights how you do it with a few examples?

Thanks!

For just a very simple thing, like showing or hiding a single thing, there’s nothing wrong with using show/hide actions.

But for more complex scenarios, where you need to show or hide multiple things at once, using custom states is a log simpler then trying to use multiple conditional show/hide actions.

That said, I almost always use custom stated to control visibility of elements on the page.

2 Likes

Thank you for your reply.

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.