Hi. I am trying to do the same steps Show/Hide a component on button click - App Building - Retool Forum
But in my version the is no layout section. Where can i find it? My rigth panel looks like this:
Hi. I am trying to do the same steps Show/Hide a component on button click - App Building - Retool Forum
But in my version the is no layout section. Where can i find it? My rigth panel looks like this:
Hi @Anton_Ermakow,
What exactly are you missing? The "hidden" input is visible in your screenshot in the Appearance section.
If you're trying to set something up to toggle the visibility of a component, you need to create a new JS query to handle the state. For example, a new JS Query called toggleViz
with the following code:
localStorage.setValue('hideComponent', !localStorage.values.hideComponent ?? false)
This will toggle the value back and forth on each click
Then, on the component you want to show/hide, set the "hidden" value to
{{ localStorage.values.hideComponent ?? false }}
That will match the hidden property to the value of toggleViz
, and default to "not hidden" (false) if there is no state set.
Then on your button, add a click event handler and configure it to run the toggleViz
query.
Thanks. This is what I was looking for.