Skip to main content

I’m trying to switch a variant of component instance by switching variable mode. This works perfect once the component A is on top level and not nested.


But if I nest component A into component B and then change the variable, the instance of component A still changes the variant as supposed but this also resets all other other properties of comp A to their defaults.


This doesn’t happen when comp A is not nested.


Tried with several components even with the simplest created from scratch.


This topic doesn’t relate to prototypes and interactivity.

Hello.

Same here, and it’s really annoying in a design system used by others designers…

Off course, they are complaining!


Edit —

I tried to use Text string and Numbers as variables… the same reset happens.


I’m having same issue of icons with variables assigned disappearing on theme switch.



Same issue for my Team.


Same issue here:



Figma’s reply:



This is a known limitation of variants nested in other variants. I’ve gone ahead and added your details to the report so they can continue tracking impact.


I’m also going to forward this to our product development team for review. While we can’t guarantee implementation, please know that your feedback is highly valued and will be taken into consideration for future updates. You can check out our Releases to stay up to date on all of our major product news.



What’s the purpose of component-based design systems if the components fail to work?

I think debugging this one needs to be the main focus for the Figma dev team. Who cares about AI, new UI, and Figma slides releases if the core of your main product is buggy?

Sorry, just a little bit fed up with this one.


Same problem here, someone found a workaround?


Hi, I have a similar issue:



  • I create nested overrides inside a variant set

  • I bind this variant set’s property to a variable that has modes matching the property’s value

  • When switching modes on an instance of my component, nested overrides carry over

  • But when inserting that instance inside another component, and switching modes on an instance of that other component, overrides on the (double) nested instance are reset


Everything is explained in this Draft


It track with the behavior quoted by @Sean_Cooley above, but really shouldn’t.


Yet another example of heavy limitations to the variable feature, that doesn’t pair well with other features such as variants and overrides. Another reason why variables should never have moved out of beta.


My temporary workaround, worked on my case is,


to create another component set with your component nested with the variants you want to manage with variables or modes.


It will preserve the overrides, and dynamic with modes and variables:


Solution:




  1. button got size variable with small, medium and large attributes




  2. I am switching them with my layout presets via modes.




  3. When I change the modes for the instance, it resets the overrides (text)




  4. I create a component set, with my components manually set the sizes and and created size variations with same attributes




  5. Used the component instance and applied the variable for that top level component






  1. I can preserve the overrides that way and use modes



It adds a level of complexity but can be used as a last resort, temporary, till the bug fixed


This is a major issue, and I still can not get how it is noticed or fixed.

That single bug ruining my well planned project, I am creating custom components with different texts and properties and using them.


Adding a data point to the issue.


It happens to several nested instances within the same component I made, with and without variables. All the remedies require adding a great amount of complexity to the component, or we have to break the nested instances.


Hope the team prioritize the fix of this issue soon.


Reply