Reference API Roblox

Engine API

Website

Related

Reference API Roblox

UIFlexItem

Defines flex behavior for a GuiObject within a UIListLayout.

Member index 4

HistoryMember
598FlexMode: UIFlexMode
598GrowRatio: float
598ItemLineAlignment: ItemLineAlignment
598ShrinkRatio: float
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
486GetChildren(): Objects
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
553children(): Objects
553clone(): Instance
573destroy(): null
553findFirstChild(name: string, recursive: bool = false): Instance
553getChildren(): Objects
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
647isA(className: string): bool
647Changed(property: string)

Description

The UIFlexItem object defines flex behavior for its parent GuiObject under the control of a UIListLayout. The defined flex behavior overrides that of the controlling UIListLayout, letting you configure flex behavior on a per‑object basis where necessary.

Example of UIFlexItem applied to a specific GuiObject under control of a UIListLayout. Example hierarchy of a UIFlexItem parented to a GuiObject under control of a UIListLayout.

History 9

Members 4

FlexMode

TypeDefault
UIFlexModeNone

UIFlexMode value which defines how the parent GuiObject grows or shrinks with available space in the flex layout container.

When the container's size is larger than the flex line's combined basis size, a value of UIFlexMode.Grow sets an effective 1:0 grow‑shrink ratio on the parent GuiObject. Objects set to UIFlexMode.Grow never shrink below their basis size, so overflow may occur if the container becomes smaller than the line's combined basis size.

Diagram showing two items in a line with FlexMode set to Grow.

When the container's size is smaller than the flex line's combined basis size and the controlling UIListLayout is not set to wrap (resulting in overflow), a value of UIFlexMode.Shrink sets an effective 0:1 grow‑shrink ratio on the parent GuiObject. Objects set to UIFlexMode.Shrink never grow above their basis size, so underflow may occur if the container becomes larger than the line's combined basis size.

Diagram showing two items in a line with FlexMode set to Shrink.

When the container's size is either larger or smaller than the flex line's combined basis size, a value of UIFlexMode.Fill sets an effective 1:1 grow‑shrink ratio on the parent GuiObject. This setting ensures the flex line always fills the container, even if the container size changes.

Diagram showing two items in a line with FlexMode set to Fill.

For fine-tuned layouts, a value of UIFlexMode.Custom enables the GrowRatio and ShrinkRatio properties, allowing for relative growth or shrinking of the object in a ratio compared to other flex objects also under control of a UIFlexItem.

History 1

GrowRatio

TypeDefault
float0

If there is free space in the flex line, this property determines the amount the parent GuiObject grows relative to other flex items in the line. Applies only if FlexMode is set to UIFlexMode.Custom.

History 1

ItemLineAlignment

TypeDefault
ItemLineAlignmentAutomatic

Cross-axis alignment of the specific parent GuiObject within the flex line. See UIListLayout.ItemLineAlignment for details.

History 1

ShrinkRatio

TypeDefault
float0

If there is overflow in the flex line, this property determines the amount the parent GuiObject shrinks relative to other flex items in the line. Applies only if FlexMode is set to UIFlexMode.Custom.

History 1

Settings