If I understand the question correctly, I think you’re asking if you can collapse the width of an element when it’s not visible…
The short answer is it’s not possible with the legacy responsive engine, but perfectly doable, and very simple, with the new responsive engine.
So if you’re using the old engine, there are a couple of workarounds - one would be to use some custom CSS (search the forum for ideas), the other way is to use a repeating group to display the badges.
If you’re using the new responsive engine then it’s as simple as checking the ‘Collapse when hidden’ box on the element (assuming your container element is set up as a row).
If you’re original question was more about collapsing height, then that’s possible in the old engine - just check the collapse height when hidden box.