Skip to main content
Question

Maintaining child component dimensions with instance swap

  • May 10, 2024
  • 2 replies
  • 399 views

justin.fraga

I’ve seen lots of complaints about child components persisting their original sizing during instance swaps with the parent. I have the opposite problem: I want a child component to keep its size when I swap it in. For some reason I can’t figure out why “Child B” in this case adopts the size of “Child A” when I swap them in a Parent instance – if I detach the Parent instance from the Parent component and swap the Children they adopt their original size.

This topic has been closed for replies.

2 replies

justin.fraga

Test file in case someone can tell me what Im doing wrong with my autolayout settings, or if I need to house the Child component in a frame or something…

Figma – 10 May 24

y_toku
Figmate
  • Community Support
  • May 14, 2024

Hi there,

Thanks for reaching out. This is a longstanding issue unfortunately. When you swap instances, the size doesn’t change. However, there’s workaround. For now, if you add auto layout to each state of your set, I think you should be able to swap and see your frames correctly resize

I hope this will help you but please feel free to let us know if you have further questions!

Thanks,
Toku