Class · inherits UIGridStyleLayout
UIListLayout
Positions sibling UI elements in rows or columns within the parent UI container.
About UIListLayout
A UIListLayout positions sibling UI elements in rows or columns within
the parent UI container, based on the
FillDirection. The
Position and Rotation
properties of each sibling GuiObject are either ignored or overridden
by the list layout, while each sibling retains its defined
Size unless the layout is configured to utilize a flex
layout. See List and Flex Layouts for
further information.
To control the layout order of siblings, set
SortOrder to either SortOrder.Name or
SortOrder.LayoutOrder, then rename siblings in alphanumerical order or
set their LayoutOrder value, respectively.
UIListLayout will automatically re‑layout elements when elements are
added/removed, or if a sibling's Name or
LayoutOrder changes.
Padding between siblings is controlled through the
Padding property, and wrapping within the parent
container's bounds through the Wraps boolean.
Alignment of siblings within the parent container is controlled through
HorizontalAlignment and
VerticalAlignment unless the layout is
configured to utilize a
flex layout.
Note that there are performance implications of using a
flex‑enabled list layout,
since extra calculations are needed to calculate flex basis sizes, flexed
sizes, and line wrapping. Flex is enabled on a UIListLayout when the
following properties are set, or if any GuiObject sibling has a
UIFlexItem parented to it:
HorizontalFlexand/orVerticalFlexare not set toUIFlexAlignment.None.ItemLineAlignmentis not set toItemLineAlignment.Automatic.Wrapsistrue.
Properties 5
HorizontalFlex
: UIFlexAlignmentControls how to distribute extra horizontal space.When the list layout's
FillDirectionis set toFillDirection.Horizontal, theHorizontalFlexproperty specifies how to distribute extra horizontal space in the parent container.Cross-Direction Behavior
In vertical list layouts (
FillDirectionset toFillDirection.Vertical), theHorizontalFlexproperty specifies how to distribute the siblings across the horizontal cross‑direction. In such layouts, a setting ofUIFlexAlignment.Fillmakes the siblings fill the entire horizontal space while vertical spacing adheres toVerticalFlex.AutomaticSize Interaction
If
GuiObject.AutomaticSizeis enabled for a child of theUIListLayoutin theFillDirection, it is interpreted as "automatic flex basis" and it defines the size of theGuiObjectfrom which it can grow or shrink.If
GuiObject.AutomaticSizeis enabled for a child of theUIListLayoutin the cross‑direction, it is interpreted as "automatic cross size" and it defines the minimum size needed to contain all the child's content in the cross‑direction.ItemLineAlignment
: ItemLineAlignmentIn a flex layout, defines the cross-directional alignment of siblings within a line.In a flex layout, defines the cross-directional alignment of siblings within a line. See
ItemLineAlignmentfor visual examples.Padding
: UDimAmount of free space between each element.Determines the amount of free space between each element, set to either a scale (percentage of the parent's size in the current direction) or an offset (static spacing value similar to pixel size).
VerticalFlex
: UIFlexAlignmentControls how to distribute extra vertical space.When the list layout's
FillDirectionis set toFillDirection.Vertical, theVerticalFlexproperty specifies how to distribute extra vertical space in the parent container.Cross-Direction Behavior
In horizontal list layouts (
FillDirectionset toFillDirection.Horizontal), theVerticalFlexproperty specifies how to distribute the siblings across the vertical cross direction. In such layouts, a setting ofUIFlexAlignment.Fillmakes the siblings fill the entire vertical space while horizontal spacing adheres toHorizontalFlex.AutomaticSize Interaction
If
GuiObject.AutomaticSizeis enabled for a child of theUIListLayoutin theFillDirection, it is interpreted as "automatic flex basis" and it defines the size of theGuiObjectfrom which it can grow or shrink.If
GuiObject.AutomaticSizeis enabled for a child of theUIListLayoutin the cross‑direction, it is interpreted as "automatic cross size" and it defines the minimum size needed to contain all the child's content in the cross‑direction.Wraps
: booleanControls whether siblings within the parent container wrap.Controls whether siblings within the parent container wrap to another line when their default size exceeds the width/height of the container's bounds.
UIListLayout also has every member of UIGridStyleLayout. Deprecated and Roblox-only members are hidden.
Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.