Change variant on resizing a component

Hey all. I was wondering is it possible to use min and max width/height of an component and use it for trigger to change a variant. For example: I have a proerty Size, and I have a component with 3 sizes. I want whaen I use the component when resizing it to automatically switch to 1 of the 3 sizes using height/width as a trigger. Is this possible.

Hey Martin, this is a great question! Did I understand this correctly you want to resize your component and trigger the variant with it? Let me ask internally and come back to you once I get more information from the team.

Yes. So I have a component and variant prioperty calles Size with variants S, M, L. I want to auto switch between these variants when using the component and resizing it.

For ex: S is triggered when height is < 16px, M when between 17 and 32 and etc.

Thank you for clarifying!
I’d suggest working with conditionals. Conditional is a rule that defines if an action should trigger. They are written with if/else logic.

As an example in your case: If height is < 16px than (you’ll receive) Variant S. If not, or else M.

Please let me know if you’ve already tried applying conditionals or if you need help to implement it. Happy to help further!

I was trying to solve the problem. But isn’t what you are saying only while viewing prototype?

were you able to figure it out ?

Hey @gtr!
Yes you’re right this action works when viewing prototypes, you can use multiple actions and conditionals to handle multiple or different outcomes within the same interaction.

Is this not what you’re trying to achieve?