Figma Support Forum

Interactive components need variable to control the properties values

Have you considered the idea to allow me to define variable, set the variable, and let that variable/value be a variant property / property value?

I want to have a set of buttons where one is in an active state and the other are in a default state. When I click the button, I want the action to set the variable to a value (string or boolean). I want to be able to use that variable/ value combination in one or more components as the property / value that sets the variant state for the component.

This would give me incredible flexibility and more importantly, it would mean that I can avoid all of this component nesting BS and action overrides issues that makes interactive components kinda useless.

If I could also drive the active artboard / app state with a variable, then it gets really interesting.

I click a button to set a variable called “activeState” to “home”. My home button variant is tied to activeState and sets its variant with some simple case logic. If I have a variant called “home” it uses it, else it uses the default variant. Also, the current artboard is tied to the same property and switches when I click it.

It sounds like Axure a little bit.
But I remember having the same need several times and told myself “this could be awesome if we could set variables and use their values in dynamic texts or prototypes to set the value of variants”.
You have my vote :smiley: