Hi guys, I’m trying to create a navigation bar and a control panel with several nested symbols with on/off states. When I click the symbol within the bar or panel, it takes me straight to the artboard of the other state of that button. Ex- I click WiFi On in the nested symbol control panel, and it takes me to the artboard of WiFi OFF and breaks my prototype. I’d like it to toggle the symbols within the same artboard of the control panel and navigation. Anyone know how to do that? Thanks
Hello. You can do this by making use of the custom Layer Visibility toggle to show/hide certain layers or groups in your design on each click.
I’ve made a basic example file and attached it here. Hope it helps.
toggle-switch.sketch (15.3 KB)
Hey thanks again for the prompt response.
I see, that’s very clever. A few things-
- I’ve actually made two separate symbols for both states, and I’ve done that across my entire library. I’ve taken care that the symbol dartboard is of the same size so I can easily override and swap symbols. Any way the prototyping can work as a shortcut of symbol override? That is, replace the current state symbol with the other state symbol?
- For some reason my Action dropdown is disabled-
That’s a really good idea though, thanks!
On your first point, it’s not possible to swap out one Symbol for another Symbol on click, but what you can do is have one parent Symbol that contains both the On and Off Symbols. Then use the Layer Visibility toggle within that to show/hide one of the Symbols on subsequent clicks.
There is another way to do this using an Overlay Artboard instead of a Screen Artboard. But to be honest, the end result will be pretty much the same as using the Layer Visibility option. The one difference though is that you can use a quick Dissolve transition between the two switches.
See the video and the attached example below.
toggle-switch-2.sketch (10.3 KB)
On your second point, the reason the Action dropdown is disabled is related to the above point: It’s because you are currently trying to link to a regular Screen Artboard, rather than an Overlay Artboard.
That is to say, for regular Screen to Screen transitions, you can’t “show” the second screen, but rather you can only directly link, or completely move, to them. Whereas for Overlays, you can simply show them in place, in addition to remaining on your current screen.
Hey Brett, thanks again for your detailed response. This was a fun experiment.
So what I did was convert the OFF state symbol artboard to an Overlay, and align it exactly on top of the ON layer. So sure enough when I click ON, it shows me the OFF symbol in the same place, even in the nested symbol which is my control panel UI. So mission accomplished! I think I’ll stick with the overlay method since that way I have all my button states available at a glance and I think that’ll be easier for dev too since they’ll have all states visible side by side.
Your responses have solved my query so thanks a lot!