Skip to main content
New Member
January 22, 2024
Question

Instant swap property distorts nested component aspect ratio when the two instances aren't the same size

  • January 22, 2024
  • 12 replies
  • 1836 views

Hi all! I searched Figma forums all over for an answer but couldn’t find one. The issue I’m having is with icons becoming distorted when using instance swap in a nested component. Here’s the context:

I am working on a design system that utilizes 4 different icon sizes that are all square (14x14px, 24x24px, and so on).

We are using Font Awesome icons, and the vectors of these icons vary in size, meaning that two icons with the same height may vary in width.

My ideal vision is that we make the icon frame sizes components, then place the icons (also components) inside of the square frame and set them to scale. This is so that if we ever decide to do a global icon resize (say we decide 14x14 is to small and want to move to 16x16) that we can do that on the master component level and avoid manually updating all the affected components.

However, the issue I am having is that when I swap one icon for another in a child component, rather than maintaining its proportions, it takes on the size of the icon it is replacing. this only happens on my nested component icons.

I want to know if there is a solution other than having to put all my icons in perfectly square frames so to fit the icon frame standards. I tried using the auto-layout trick, but because the master component icons are sized at 36px height, they aren’t scaling down to our smaller icon frame sizes (14px and 24px). trying to also avoid creating 3 different size variants for every icon if possible.

I hope that makes sense. heres some screenshots for context.

This topic has been closed for replies.

12 replies

April 30, 2025

im struggling with this still

Julian_Castano1
New Participant
August 28, 2025

Hi, this happens when I try to change an icon with a different element, like a toggle or button. Doesn’t matter the levels or complexity or nesting inside a container, it always stretches.

I have different files for Icons & Elements that I reuse in the same component.

 

It’s very annoying to detach elements in the design.

Still no news from Figma about this bug?