Reference API Roblox

Engine API

Website

Related

Reference API Roblox

UIListLayout

Positions sibling UI elements in rows or columns within the parent UI container.

Member index 7

HistoryMember
647HorizontalFlex: UIFlexAlignment
647ItemLineAlignment: ItemLineAlignment
553Padding: UDim
647VerticalFlex: UIFlexAlignment
598Wraps: bool
inherited from UIGridStyleLayout
553AbsoluteContentSize: Vector2
553FillDirection: FillDirection
647HorizontalAlignment: HorizontalAlignment
553SortOrder: SortOrder
647VerticalAlignment: VerticalAlignment
573ApplyLayout(): null
573SetCustomSortFunction(function: Function = nil): null
inherited from Instance
553Archivable: bool
635Capabilities: SecurityCapabilities
553Name: string
553Parent: Instance
635Sandboxed: bool
616UniqueId: UniqueId
576AddTag(tag: string): null
573ClearAllChildren(): null
462Clone(): Instance
573Destroy(): null
486FindFirstAncestor(name: string): Instance
486FindFirstAncestorOfClass(className: string): Instance
486FindFirstAncestorWhichIsA(className: string): Instance
486FindFirstChild(name: string, recursive: bool = false): Instance
486FindFirstChildOfClass(className: string): Instance
486FindFirstChildWhichIsA(className: string, recursive: bool = false): Instance
486FindFirstDescendant(name: string): Instance
563GetActor(): Actor
486GetAttribute(attribute: string): Variant
462GetAttributeChangedSignal(attribute: string): RBXScriptSignal
631GetAttributes(): Dictionary
648GetChildren(): Instances
462GetDebugId(scopeLength: int = 4): string
486GetDescendants(): Array
486GetFullName(): string
641GetStyled(name: string): Variant
576GetTags(): Array
576HasTag(tag: string): bool
486IsAncestorOf(descendant: Instance): bool
486IsDescendantOf(ancestor: Instance): bool
580IsPropertyModified(name: string): bool
573Remove(): null
576RemoveTag(tag: string): null
580ResetPropertyToDefault(name: string): null
573SetAttribute(attribute: string, value: Variant): null
462WaitForChild(childName: string, timeOut: double): Instance
648children(): Instances
553clone(): Instance
573destroy(): null
553findFirstChild(name: string, recursive: bool = false): Instance
648getChildren(): Instances
553isDescendantOf(ancestor: Instance): bool
573remove(): null
462AncestryChanged(child: Instance, parent: Instance)
462AttributeChanged(attribute: string)
462ChildAdded(child: Instance)
462ChildRemoved(child: Instance)
462DescendantAdded(descendant: Instance)
462DescendantRemoving(descendant: Instance)
500Destroying()
553childAdded(child: Instance)
inherited from Object
647ClassName: string
647className: string
647GetPropertyChangedSignal(property: string): RBXScriptSignal
647IsA(className: string): bool
650isA(className: string): bool
647Changed(property: string)

Description

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.

UIListLayouts illustrating FillDirection of either horizontal
or vertical.

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.

List layout examples illustrating numerical LayoutOrder
sorting or alphanumerical Name sorting.

Padding between siblings is controlled through the Padding propertly, 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:

History 14

Members 7

HorizontalFlex

TypeDefault
UIFlexAlignmentNone

When the list layout's FillDirection is set to FillDirection.Horizontal, the HorizontalFlex property specifies how to distribute extra horizontal space in the parent container.

SettingSibling Behavior
NoneNo flex behavior; siblings maintain their defined width.
FillSiblings resize horizontally to fill the entire parent container, overriding their defined width. The number of siblings in a row remain unchanged; for example, if three siblings fit horizontally within the container's width under the None setting, those three siblings will resize to fill the entire width.
SpaceAroundSiblings maintain their defined width. Equal spacing is added on both sides of each sibling.
SpaceBetweenSiblings maintain their defined width. Equal spacing is added between siblings, but no additional space is added around siblings.
SpaceEvenlySiblings maintain their defined width. Equal spacing is added both between and around siblings.
UIListLayout examples showing how each HorizontalFlex option affects the size and spacing of sibling UI objects.

Cross-Direction Behavior

In vertical list layouts (FillDirection set to FillDirection.Vertical), the HorizontalFlex property specifies how to distribute the siblings across the horizontal cross‑direction. In such layouts, a setting of UIFlexAlignment.Fill makes the siblings fill the entire horizontal space while vertical spacing adheres to VerticalFlex.

Diagram showing how HorizontalFlex affects the horizontal size of sibling UI objects when the UIListLayout fill direction is set to vertical.

AutomaticSize Interaction

If GuiObject.AutomaticSize is enabled for a child of the UIListLayout in the FillDirection, it is interpreted as "automatic flex basis" and it defines the size of the GuiObject from which it can grow or shrink.

If GuiObject.AutomaticSize is enabled for a child of the UIListLayout in 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.

History 2

ItemLineAlignment

TypeDefault
ItemLineAlignmentAutomatic

In a flex layout, defines the cross-directional alignment of siblings within a line. See ItemLineAlignment for visual examples.

SettingSibling Behavior
AutomaticAligns the layout's siblings or the specific UIFlexItem parent to the layout's HorizontalAlignment or VerticalAlignment, depending on its FillDirection.
StartAligns the layout's siblings or the specific UIFlexItem parent to the line's top in a horizontal fill or the line's left in a vertical fill.
CenterAligns the layout's siblings or the specific UIFlexItem parent to the line's center in either a horizontal or vertical fill.
EndAligns the layout's siblings or the specific UIFlexItem parent to the line's bottom in a horizontal fill or the line's right in a vertical fill.
StretchStretches the layout's siblings or the specific UIFlexItem parent to fill the entire cross‑direction of the line in either a horizontal or vertical fill.
Examples of options for ItemLineAlignment in a horizontal fill direction.

History 2

Padding

TypeDefault
UDim0, 0

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).

History 4

VerticalFlex

TypeDefault
UIFlexAlignmentNone

When the list layout's FillDirection is set to FillDirection.Vertical, the VerticalFlex property specifies how to distribute extra vertical space in the parent container.

SettingSibling Behavior
NoneNo flex behavior; siblings maintain their defined height.
FillSiblings resize vertically to fill the entire parent container, overriding their defined height. The number of siblings in a column remain unchanged; for example, if three siblings fit vertically within the container's height under the None setting, those three siblings will resize to fill the entire height.
SpaceAroundSiblings maintain their defined height. Equal spacing is added on both sides of each sibling.
SpaceBetweenSiblings maintain their defined height. Equal spacing is added between siblings, but no additional space is added around siblings.
SpaceEvenlySiblings maintain their defined height. Equal spacing is added both between and around siblings.
UIListLayout examples showing how each VerticalFlex option affects the size and spacing of sibling UI objects.

Cross-Direction Behavior

In horizontal list layouts (FillDirection set to FillDirection.Horizontal), the VerticalFlex property specifies how to distribute the siblings across the vertical cross direction. In such layouts, a setting of UIFlexAlignment.Fill makes the siblings fill the entire vertical space while horizontal spacing adheres to HorizontalFlex.

Diagram showing how VerticalFlex affects the vertical size of sibling UI objects when the UIListLayout fill direction is set to horizontal.

AutomaticSize Interaction

If GuiObject.AutomaticSize is enabled for a child of the UIListLayout in the FillDirection, it is interpreted as "automatic flex basis" and it defines the size of the GuiObject from which it can grow or shrink.

If GuiObject.AutomaticSize is enabled for a child of the UIListLayout in 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.

History 2

Wraps

TypeDefault
boolfalse

Controls whether siblings within the parent container wrap to another line when their default size exceeds the width/height of the container's bounds.

Diagram showing how Wraps affects how siblings are distributed within the parent container's bounds.

History 1

Settings