Layout Elements

ELEMENTS uses a Flex Box based layout system, just like UI Toolkit. This is made easily accessible using layout elements called Groups.

There are two main types of group: VerticalGroup, and HorizontalGroup. As the names suggest, these elements render their children either vertically or horizontally. You can also easily control the alignment of the children within these groups.

Examples

To create a VerticalGroup...

return new VerticalGroup(
  child,
  child
  child
)
Vertical Group
Child
Child
Child

To create a HorizontalGroup...

return new HorizontalGroup(
  child,
  child,
  child
)
Horizontal Group
Child
Child
Child

Alignment and justification

Typically alignment and justification on a group are controlled using USS, however ELEMENTS provides handy convenience methods to easily adjust this.

return new HorizontalGroup(
  child,
  child,
  child
).AlignItems(Align.Center).JustifyContent(Justify.SpaceBetween)
Horizontal Group
Child
Child
Child