Skip to main content
Alina_Trussova
New Participant
September 8, 2023
Solved

Nested component, instance swap and stroke scaling issue

  • September 8, 2023
  • 26 replies
  • 4501 views

Icon stroke width behaves as expected inside the button (it scales with the canvas). However, as soon as it’s turned into a component and the icon is swapped, the stroke resets to a default value of 2px. The frame size behaves as expected.
Icon is resized using scale tool.

Problem appears both ways:
– creating button from scratch (works), make is a component (does not work).
– creating button component with same anatomy from scratch (does not work). Detach the same component (works).

Creating different sizes with variants for each icon is not an option due to the extensive icon library.

Is this a bug, or what could be causing this issue?

This topic has been closed for replies.
Best answer by tank666

Most likely you need to override the icon stroke weight in each button variant.

26 replies

tank666
September 8, 2023
UX/UI designer. Figma expert. Creator and developer of plugins and widgets for Figma and FigJam. Check out my resources in Figma Community: figma.com/@tank
Alina_Trussova
New Participant
September 8, 2023

Thanks!
– Icons are constructed properly (flatten, only one vector stroke layer and the same layer names, same properties)
– Also I did try creating a component responsible for size (3 sizes). It exhibits the same behaviour. When used in a button component stroke resizes back to original 2px.

Seems like a component adds additional parameters to the setup, but I can not figure out what and do I even have control over it. Currently it’s seems like a bug to me.
Does anybody have any ideas?

tank666
tank666Solution
September 8, 2023

Most likely you need to override the icon stroke weight in each button variant.

UX/UI designer. Figma expert. Creator and developer of plugins and widgets for Figma and FigJam. Check out my resources in Figma Community: figma.com/@tank
Alina_Trussova
New Participant
September 8, 2023

I see! That’s what I was missing! Highly appreciate your help.

Jay_Flaxman
New Member
November 10, 2023

Surely this is still a bug though? I have the same issue where I’ve created a component in which I’ve added an instance swap property for a nested component that I’ve scaled up. As soon as I try swapping the instance of the nested component, the stroke thickness reverts back to the original. If the original instance is scaled, why would the scale not apply to the swapped instance?

Lucas_del_Rio
November 16, 2023

This is a bug clearly. Been struggling these paste days with the same issue. Makes no sense honestly.

Alina_Trussova
New Participant
November 27, 2023

Hi! I have been testing and noticed that I do not experience this problem anymore even without workaround.
So it looks like the bug is fixed now and maybe latest Figma update will help?

Mads_Hensel_dk
March 15, 2024

Ran into this problem/bug again today, so I don’t think it’s been fixed yet!

Amy_Martens
March 15, 2024

This definitely still happens and causes a lot of pain trying to use stroke based icon libraries with a design system built in Figma

March 26, 2024

Still same issue, If ikon or illustration with stokes in nested level inside a parent component. Stroke will not scale if instance is scaled small or bigger.