How can I make a container shrink properly when also wraping its children?

How can I make the space on the right also shrink away when wrapping?

You could try to set either Align Items or Justify Content to the “space evenly” setting. This should distribute the space to the right across all buttons, meaning they will increase their relative distance to each other until the next button fills in that space.

Alternative is to allow the text buttons to resize but I’m not sure exactly how to do that. Probably requires setting the button max size to some high value or even 100% and allow them to shrink. This would then scale the size of buttons until one more button wraps from/to another line.

Thank you, that certainly makes it look better.
However, my goal would be to trim the red part here:9770109--1399899--upload_2024-4-14_16-53-45.png
And center the rest, do you know if that’s possible?

Hmmm. I don’t know how. Resizing the container to n number of buttons times their width plus padding should be possible to do in code. I don’t know if there’s a trick to achieve that with the element layout and settings alone.

The sizes of the actual elements will probably vary depending on the text but I guess I’ll just try doing it like that anyway.
Thank you

You basically need the containers for your elements to have a variable size. The labels (blue) in the image below have their containers (red) set to a normal width of 100 and a maximum width of 115. It’s this scaling value that allows all of them to increase just enough to hide the gap. Unfortunately the non-full row wants to scale too.

9770412–1399953–Example.unitypackage (1.03 KB)