UITK: Why is there no Box element in the Containers palette?

Subject says it all. Am I missing something? To make a box I have to user a text editor and given Unity already has the element, curious as to why it’s not available.

Box element? Containers palette? What are you referring to exactly?

UI Builder window has no Box, just GroupBox.

Wouldn’t a box just be… a visual element?

They seem/are treated different. Because the visual element is normally using the flex box to do the layout with grow settings, you can’t easily specify a fixed size and have it work with other things/children. The examples I see use VisualElement as a container and then you use the Unity control elements to style and configure. Whereas if I use a box as the grouping element it all just works better.

Anyway, I’m also asking because I’m hoping for a definitive technical answer before I go and create a bunch of UI stuff.

Couldn’t you just use a USS style to set the height and other properties of all child elements?

Say you had a visual element called Box. Then the selector #Box > * would apply to all its children.

Yes, exactly, which is why I use Box, but just have to write the code into UXML. The question in this thread is simply why isn’t Box an element that appears in the containers in UI Builder.

1 Like

This certainly is puzzling, since a Box class still exists in the UIElements namespace, is not marked as deprecated, and works fine. Anyone have any more recent insights as to why it’s not available in the Ui Builder Library? If you add it manually to the UXML file and then select it in the UI Builder, the Inspector handles it just fine.