Skip to main content
Question

Switch variants in nested components bug

  • April 25, 2024
  • 5 replies
  • 339 views

Federico_Fala

@Junko3 This issue is still persistent today.

Actually there’s 2 issues here, depending how the component is built:

  1. Firstly a nested component that uses slots loses any override when using variables, this is not the case when changing from UI
  2. For components that have nested components in the master pre-made, without using placeholders, it is not possible to use DIFFERENT variables if the variant property is the same. In my example the blue instance has a light and dark variant. The property name is “blueProp”. Because the blue instance appears twice in the green component, the “blueProp” also appears twice in the nested component panel.

See attached video for these 2 problems.

Master with pre-nested instances:

  • No problem while using UI
  • Same setup but I cannot use different variables for different nested instances

Master with placeholders / slots:

  • No problem while using UI
  • Using variables breaks / loose overrides

I can provide the file if needed. Test with Figma Beta freshly restarted and the normal Figma.

5 replies

Federico_Fala
  • Author
  • New Member
  • 3 replies
  • April 25, 2024

I also want to add that any nested instances and the parent instance with the same property name will have this issues. Red, Green and Blue are difference components.


ksn
Figmate
  • Community Support
  • 1608 replies
  • April 26, 2024

@Federico_Fala Hi! I moved your comments to a new, seaprate topic, since it was older and not necessarily caused by the same issue (i understand it’s very similar).

I will consult the support team to see if they have feedback, suggestions, or if something seems buggy.


Tricia_Spoonts

I am seeing this exact same issue. I have a component that changes orientation through a variant for responsive breakpoints. If I change the component manually in the UI all of the overrides are kept. If I use the variable it resets all of the overrides.


Yara_Farhat3
  • New Member
  • 5 replies
  • February 22, 2025

Hello, any update on this?

we need to use slots in a list component and a card component to make it flexible. Assigning variables to the text in the content component that will be inserted in the slot is reverting back to the original text values of the component when switching from english to arabic using the variable mode.


Figmashley
  • New Member
  • 4 replies
  • March 10, 2025

Following for updates! There seems to be no logical method to follow in setting up components and variable properties that ensures content overrides remain.

I see many responses suggesting layer naming to be consistent, but in most examples, people are designing their components with consistent layer names and still seeing content reset to default when switching variant – especially when nested inside another component. This is a huge bugbear in a design system.


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