Skip to Content

Layout Utilities

UtilityEffect
flexEnables flex layout behavior
hiddenHides the element
visibleMakes the element visible
invisibleMakes the element invisible while preserving layout
flex-rowLays children out horizontally
flex-colLays children out vertically
flex-row-reverseHorizontal layout in reverse order
flex-col-reverseVertical layout in reverse order
flex-wrapAllows children to wrap
flex-wrap-reverseAllows wrapping in reverse direction
flex-nowrapPrevents wrapping
overflow-hiddenClips overflowing content
overflow-visibleAllows overflowing content to render

Alignment

UtilityEffect
items-startAligns children to the start of the cross axis
items-centerCenters children on the cross axis
items-endAligns children to the end of the cross axis
items-stretchStretches children on the cross axis
justify-startPacks children at the start of the main axis
justify-centerCenters children on the main axis
justify-endPacks children at the end of the main axis
justify-betweenDistributes children with space between
justify-aroundDistributes children with space around

Self Alignment and Flex Sizing

UtilityEffect
self-autoUses automatic self alignment
self-startAligns this element to the start
self-centerCenters this element
self-endAligns this element to the end
self-stretchStretches this element
growAllows the element to grow
grow-0Prevents the element from growing
shrinkAllows the element to shrink
shrink-0Prevents the element from shrinking
flex-1Uses flexible sizing
flex-autoUses automatic flexible sizing
flex-noneDisables flexible sizing
basis-*Sets flex basis

Gap

UtilityEffect
gap-*Sets horizontal and vertical gap
gap-x-*Sets horizontal gap
gap-y-*Sets vertical gap

gap-* is emulated with margins because this Unity UI Toolkit version does not support native flex gap.

Last updated on