Why is there no fill container option when selecting child elements?

Hi, when searching for this issue the only answer I found was that one need to select a child element and not the parent one, which isn’t helpful at all bcause the component I’m trying to resize is a child of another.

I’m trying to resize frame elements so that it fills the whole white background with the icon, but there’s no option of filling a container when clicking on the frames. How do I fill it?

Here is the structure:

Hey there, I am not sure if I understand your question. Are you asking about Resize to fit?
If you are using Smart selection with frames, you can use the Resize to fit to adjust the frame to the size of the layers within it. Resize to fit is in the positioning section of the right sidebar. More information on this you can find here: https://help.figma.com/hc/en-us/articles/360040450233-Arrange-layers-with-Smart-selection#resize.
Please let me know, if this does not answer your question.

I am not sure, there should be an option called “fill container” (as well as hug content and fixed size) when assigning auto layout to the child and parent element. But for me there’s only Hug content and fixed size, no fill container for the child. The parent also has the auto layout assigned. don’t understand how it works.

I assume you’re trying to use the “Fill container” on the “Frame 3” of your screenshot. The reason it’s not working is that it’s using absolute positioning (indicated by the small square frame around the auto-layout icon).

The absolute position is useful when you want an element within an auto-layout parent to precisely ignore the autolayout, and be able to manually position it wherever you want within the parent, potentially overlapping other elements within that parent. Now, since the frame is ignoring the auto-layout from its parent, and “Fill container” can only be used when inside an auto-layout frame (while not ignoring it through absolute positioning), it can not use the “Fill container” functionality.

If you’re having the problem with all elements within your variants, it’s probably because your variants are not using autolayout.

Here’s the logic:

Let’s establish B is a frame within frame A.

  • Scenario 1:
    A auto-loyout ON
    B auto-layout OFF
    A can be fixed or hug content.
    B can be fixed or fill container.

  • Scenario 2:
    A auto-layout OFF
    B auto-layout ON
    A can only be fixed.
    B can be fixed or hug contents.

  • Scenario 3:
    A auto-layout ON
    B auto-layout ON
    A can be fixed or hug contents
    B can be fixed, hug contents or fill container.

  • Scenario 4: (what I assume is yours)
    A auto-layout ON
    B auto-layout ON - Absolute positioning ON
    A can be fixed or hug contents
    B can be fixed, hug contents BUT NOT fill container.

Hope this helps!