Skip to main content
Question

Component instances are not getting "fill" property inherited from main parent component


elmiur

I’m trying to use Figma auto layout wrap with components inside. I set the parent component width to have a fill property and set min-width and max-width values but the instances of the parent component are not inheriting the “fill container” property. Due to this minor issue I have to manually select every instance ( children components ) within auto layout and set the width to fill. Then it works. Why do I have to do this? why can’t I inherit the “fill container” from parent component?

10 replies

Gayani_S
Figmate
  • Community Support
  • 1916 replies
  • September 20, 2023

Hey Elmiur, thank you for reaching out! Could you send me a screen recording of what you’re seeing on your end please?


Fernando_Lins

If those components have no parent structures, i.e. they’re variants or main components, their fill property will not pass on to instances because they have no parent to reference their width from, so they automatically go into Hug mode, even if you place it inside an autolayout frame. Unfortunately this is unwanted behaviour but it is as Figma has always behaved in this case. Figma really should “touch” the components when they’re dragged from the component picker or library browser to have them fill according to their original rules depending on where they are being placed.


elmiur
  • Author
  • 1 reply
  • September 24, 2023

Yep they don’t reference the parent element to set the child component to fill where they are used. Setting fill property at a main component level seems useless.


OndrejZajic

I have the same issue. Is this a bug?


Gayani_S
Figmate
  • Community Support
  • 1916 replies
  • October 18, 2023

Hey there, could you share a screen recording or a link to your file with us? So we can take a closer look at it.


OndrejZajic

Hi yes, here is a screen recording.


Hana_D
  • 5 replies
  • October 20, 2023

Following !

We have the case on a slot set to fill inside a design system file

1/ we call the component from our library to build our page on another file
2/ we swap the slot with our custom-content
that is usually a single-component for this area that is set to fixed by default after a ctrl/cmd + K
3/ the behavior of Figma is to swap the content but inherit from the previous slot setting, so our previously fixed custom-content inherit the fill from the slot

→ because we are used to this we manage around this and it’s ok for our usage, and we can change to hug or fixed as we need.

BUT our design system team decided to change to a slot with a hug content setting

Now, with a slot set to hug, when we swap it, it doesn’t inherit from the hug setting and let our custom-content still be in fixed setting and also doesn’t let us the option to fill container.

We then could do a fake variant of our custom-content to create a container, that is set to fixed to encapsulate it and unveil the fill-container setting, this workaround is working when we’re inside the design system file

Alas, it doesn’t when we’re consuming the design system component from another file, and we have to click our life to enter each slot setting to override them.

Can we fix the fill/fixed/hug behavior be always inherited or never inherited consistently?


Charles_S
  • New Participant
  • 9 replies
  • November 11, 2024

This has been a frustration of mine for a while now. I create components, like cards, then pull them into an autolayout box in my page. I can set fill for width. but not for height. No clue why other than this possible reason.

If there’s no fix for this, is there a forum post voting to add this feature?


Frederic_Giroux

Having the auto-layout property kept from the component would be very useful. Especially for components embedded into more complex ones. 

My example is a table cell set with various predefined sizes (eg 200, 300, 400px, etc.) plus a fluid/responsive size that I would want it to keep the Fill property. When embedded into the row component, I want to have the ability to change the size of each cell without detaching the row component nor manually changing the auto layout property. 

Currently I’m able to change the size of a cell between the fixed sizes, but if I select the fluid/responsive option, it does not inherit the Fill property. Therefor I need to manually change its auto layout property. 

Having to manually do this change is not a suitable option for design systems that are used by multiple designers with various level of experience & Figma knowledge. 


iago
  • New Participant
  • 16 replies
  • February 20, 2025

One thing you can do to seed up the process is to select the container holding the cards and hitting enter, that will select all content within and you can change all at once. If they are in different screen, you can use the select mathcinh layers buttom (option + command + A after selection the 1st one)


As for ​@Charles_S this may help:
 

 


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