tisho / Switch.framerfx

Utility component for Framer X that lets you switch between different states of an element
31 stars 4 forks source link

[Feature request] Allowing "click through" ability #6

Open jrcollins4 opened 4 years ago

jrcollins4 commented 4 years ago

Great job on this library!

I have a tab component from our own component library that either requires code or the Switch library to implement the child view that corresponds to the current selected tab, and the Switch library makes this so much easier without our designers having to touch code.

Ideally, it would be nice to set up a Switch target on top a tab, change the view with the switch library, and then have the component execute the click as it would normally (since the active state is managed in the code component).

Is this currently achievable in Framer with the switch library? Would this be possible to implement in the future?

Thanks!

tisho commented 4 years ago

You should be able to do this using a SwitchToStateAction component (a hotspot). If you drop one on the canvas, notice that it has a connector dot on the side:

image

If you connect this dot to another component (it would need to be placed outside of the Frame), the hotspot will display that component, instead of being transparent). This will allow you to both handle your own tap events on the component AND have the SwitchToStateAction handle switching states.