Skip to main content
Question

Can i set a variant from a local variable?

  • September 25, 2023
  • 1 reply
  • 659 views

Does anyone know if it is possible to set the variant of a component from a value of a local variable?
For example I would like to select the disabled variant of a dropdown if a value of a variable is true.

Thanks

This topic has been closed for comments

ksn
Figmate
  • Community Support
  • October 17, 2023

Hey! So sorry for the delay in response to this – I checked in with our tech quality team, and it sounds like you can control a variant from a variable with a string variable. You would have to update the variable’s string to match the variants layer name and bind the variable to the instances layer.

They also advised that you can probably check with a conditional, and then if the boolean property is true or false, set the variable to the variants value you want to show.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings