I couldn’t find a bug report, so just in case I’m posting my own.
If we create a component with ‘No’ / ‘Yes’ variants (which Figma transform automagically into boolean) and we bind variable to that it’s not working. Since it shows as a boolean we can only bind boolean variable, but when we do that the variable name is crossed out and it’s not working.
I suspect it happens because Figma still treats that variant as a ‘string’. If I change variant names to something else (so it’s not transformed into boolean) and I use string variable it’s working just fine.
Hi @n_zrk, Thank you for reaching out regarding boolean property and string variables. We appreciate your insights and troubleshooting on this issue.
While I may not fully grasp your situation, I conducted a test on my end and was able to attach a string variable to the text layer nested within the instance that has a boolean property.
I hope this information proves helpful, but there’s a possibility that I may have overlooked something…
If that’s the case, could you please provide a brief video recording demonstrating the issue? Kindly show the full Figma screen, including the left and right panels, to display the exact names of the layers and properties. This visual aid will greatly assist the community in understanding the issue and enable us to replicate the behavior for further analysis.
If any members of our community have encountered a similar issue and have suggestions or workarounds, please do not hesitate to share them!
That’s not the case I was describing. Let me provide the video to be more clear.
If you create a component with variant values named No and Yes, Figma will automatically change it into a boolean toggle. You can attach a variable to this boolean, but Figma only allows to use boolean variable there while (this is my assumption) it still treats it as a string (No / Yes named variants). As a result attached boolean variable is not working. The example you provided is not using variants, it’s using a component boolean property which is a different case.
Hi @n_zrk, Thank you for pointing that out! I really appreciate you sharing helpful information and recording with us.
I tried it on my end and I was able to replicate the same issue where setting variant property values as [Yes] and [No] shows a boolean toggle for that instance property but doesn’t allow attaching boolean variables.
I think this behavior might be because the boolean variable value(True/False) doesn’t match the variant property values(Yes/No). For example, when setting variant property values as [True] and [False], you can attach boolean variables to the instance toggle.
However, I totally understand that this can be confusing. I have raised this concern internally and will update you as soon as I have more information.
Thank you for your assistance! If there’s anything else I may have missed, please feel free to let us know.
If anyone from our community has insights, please join the conversation!