Instances not resizing with variable swaps

This is happening because nested instances keep their size upon swapping. There is no way to avoid this key mechanic. However, there is a workaround: the instance needs to have auto layout enabled with Hug constraints.

Resizing options in the right panel: both axis are set to hug contents for the nested instances

Example file: https://figma.fun/pI2KuG

Components: resizable and non-resizable, fixed and auto layout


Unfortunately, if you want to keep this component manually resizable like without auto layout, you would also have to adjust its contents to fill container manually since fill container and hug contents are incompatible with each other. Or you can set it to fixed + fill container by default but then change it manually in nested instances to hug contents.

15 Likes