Apply Boolean visibility Property For layer inside component

I want to create properties to hide/show layers inside a Component but the problem is when I set these properties to false the auto layout doesn’t shrink, it appears like it’s set to fixed size.

these are the properties

if I hide one item


if I hide Both items

I have tried to create property for items parent but it leave this weird box in the design, although it’s not visible in prototype

Hi @mo_hamwi

Did you make sure that you don’t have a conflict where the parent (blue container) would have its height set at hug while the remaining children are set at fill (which will result by an overriding of Figma to the parent’s height at fixed)

If all your children have their height set at hug or to a fixed value it should work just fine

Otherwise, are you able to share the structure of your component so we can help you better?

Hope it helped

1 Like

thank you for replay I have the button set to fixed and the texts set to hug

here is the structure of the component

when I hide the text and the button layer the COVER Frame start to act weird “their parent”

According to your last sharing, when you toggle off properties show text and show button you left an empty auto-layout frame Cover. Note that when you hide an element in an auto-layout frame, with a height set to hug, the frame will just keep it size.

You can either
remove the Cover frame so your structure will looks like this :

  • logo
  • Text
  • Button

or add another property (e.g show cover) which can display/hide the whole frame

Hope it helped

1 Like

Thank you so much for your help it seems there is bug in Figma when I tried to hide cover layer it leaves behind this weird box, although it’s not affecting the ui but it’s visible as I shown before

if I reload the “Figma tab” it’s gone
but I have to reload every time I make a change