I’m building a simple component using a vertical stack with a label and a description.
In order to add padding around each text, I need to wrap them in an extra group or stack. However, groups and stacks don’t have an enable/disable switch in instances. When I turn off the text override, the text disappears, but the wrapper group/stack remains, so the vertical stack still preserves the empty space.
When using plain text layers (without wrapping), disabling the text correctly collapses the layout and the component height shrinks. But once wrappers are needed for spacing, this behavior is lost, making it harder to build flexible components with optional elements.
Could you share a sample document with us? We’d love to try and get this to work for you!
You could also try hiding (Select element(s) on the Layer list within the Symbol Instance, and press ⌫ Backspace) the Stack where the text element is. That might do the trick, but then again, we’d love to verify using your current setup!
Convert those elements into Symbols (So they become Overrides on the main Component).
Now you can toggle their visibility from the Inspector without having to hide them.
The functionality is basically the same, but in this case you’re using Overrides to show/hide the element and this will adjust the layout to account for the different in height.
Hi Leo.
This is a little bit of a quirky solution, I admit, but you might find this method to be useful for you. You can use the Alignment override to get the same result. No additional Symbols, and no additional Stacks.