Parent frames with child props

I’m building some basic table cell components which have ‘Left content’ and ‘Right Content’ all with Boolean props on them. I’ve noticed if I turn off the Right Label and Subtitle text layers, the frame itself doesn’t collapse therefore still taking up the space. Is this intended or a bug? The frame is set to ‘Hug’ so if nothing inside is visible surely it should collapse to 0 width and allow more room for the left content.

I really don’t want to add another Boolean to the Left and Right frames as I feel this over complicates the component.

Hey Anthony,
Yeah, as I understand currently it works exactly like this.

So, if you want to show “Label” OR “Subtitle” unfortunately you need to create an additional property for the whole “Right” container.

If one of the nested elements can’t be shown without another one (for example, “Label” is only visible when “Subtitle” is turned on) you can add the “Show Subtitle” boolean property for the whole “Right” group. In this case, the “Right” container will be shown when “Subtitle” is checked and “Label” will be optional then.

1 Like