make sure to name your button showHide
this starts off with component hidden and will show it. If you want to start with it shown and then hide it, use the following:
In the button CL:
label:
when numericValue("(-1)^{${this.pressCount}}") = 1 “Hide”
otherwise “Show”
The other nice thing with mod is you can have more than a binary on/off toggle. I have some activities were I might have something “toggle” mod 4 or 5 or whatever, to cycle through several states and then start over.