Skip to Content
Kinemium

UIGridLayout

Arrange GUI children in a grid of cells.

UIGridLayout positions the children of a GUI object in a grid. You set the cell size and padding, and the layout places children row by row until the available space is used.

Getting started

local grid = Instance.new("UIGridLayout")
grid.CellSize = UDim2.fromOffset(96, 96)
grid.CellPadding = UDim2.fromOffset(8, 8)
grid.FillDirection = Enum.FillDirection.Horizontal
grid.Parent = frame

Properties

PropertyTypeAccessDescription
EnabledbooleanRead/writeWhether the layout runs.
IgnoreInvisiblebooleanRead/writeSkip invisible children when placing cells.
FillDirectionEnum.FillDirectionRead/writeDirection cells fill.
FillDirectionMaxCellsnumberRead/writeMaximum cells in the fill direction, clamped to 0 or above.
HorizontalAlignmentEnum.HorizontalAlignmentRead/writeHorizontal placement of the grid.
VerticalAlignmentEnum.VerticalAlignmentRead/writeVertical placement of the grid.
SortOrderEnum.SortOrderRead/writeOrder used to sort children.
CellPaddingUDim2Read/writeSpace between cells.
CellSizeUDim2Read/writeSize of each cell.
AbsoluteCellCountVector2Read-onlyResolved number of columns and rows.
AbsoluteCellSizeVector2Read-onlyResolved cell size in pixels.
AbsoluteContentSizeVector2Read-onlyResolved size of the whole grid.

Notes

  • FillDirectionMaxCells = 0 means no explicit cap.
  • IgnoreInvisible skips children whose Visible is false.
  • The layout positions children but doesn't resize the parent; size the container yourself.
  • AbsoluteCellCount, AbsoluteCellSize, and AbsoluteContentSize are resolved values for reading.
  • Cloning copies the layout settings.

See also

  • UIListLayout for a single row or column.
  • UIPadding for insets around the grid.
  • GuiObject for the parent container.

On this page