How to add triggers to components?

Hello all!
I have 2 Questions:
• How can I edit the destination of the trigger layer? Like if I would like to change the variant that it should switch to on click.
• How can I add a trigger to a new custom component? I currently see it only in the Select component.

Hi! The “trigger” element is a special element for a Select component, which triggers opening the Select. When it is opened, the Is Open variant is activated.

There’s currently no way in Plasmic for you to say “clicking on this element will trigger this variant”; this kind of behavior right now is handled by writing some code in your application instead; Plasmic tries to only describe design – how things look – rather than behavior – how things work.

I see. Alright, thank you!

@chungwu is adding the “trigger” element coming to Plasmic any time soon? :slightly_smiling_face:

Probably not soon… Our stance so far is to let “behavior” live in your code, so that you can be as arbitrary and complex as you need to be. Things like this often start with “I just want to turn on this variant when I click this”, but quickly grows into general programming (if conditions, derived values, etc). That said, we do think it’s useful to have something like this even for “lightweight prototyping” and we’re thinking about it!

Sounds good. Thank you for your response :slightly_smiling_face: