Resize panel to hide contained buttons

I’m hoping to have a row of buttons contained in panel, but then resize the panel down to 10 pixels to hide the buttons until needed. I was hoping that this would just be handled by making the buttons children of the panel, but when I resize the panel down the buttons are still visible. Is there an easy way to fix this? Maybe a panel isnt the right approach? If all else fails I can resize the buttons at the same time, but I was hoping the visual effect would be a clean wipe of the buttons without deforming them, rather than squishing them as the bar shrinks.

Just add a Mask component to the panel that contains the buttons.