Skip to main content

Type Alias: UiGridLayoutGroupConstraintFields

UiGridLayoutGroupConstraintFields = { columnWidthMode?: "fixed"; constraint?: "flexible"; rowHeightMode?: "fixed"; } | { columnWidthMode?: UiGridSizingMode; constraint: "fixedColumnCount" | "fixedRowCount"; rowHeightMode?: UiGridSizingMode; }

Defined in: ui/components/layout-group-component.ts:234

How a GridLayoutGroupEcsComponent decides its column/row count, and which per-axis sizing modes are valid for that choice - columnWidthMode/ rowHeightMode: 'content' derives that axis's column/row size from its cells' own measured preferred size (see UiGridSizingMode), which only makes sense once the column/row count itself is already fixed: a flexible grid's column count depends on column width, which would depend on column count. Modeled as a discriminated union on constraint rather than two independent fields, so passing columnWidthMode/rowHeightMode: 'content' alongside constraint: 'flexible' (or its default) is a compile-time type error instead of a thrown one.

Union Members​

Type Literal​

{ columnWidthMode?: "fixed"; constraint?: "flexible"; rowHeightMode?: "fixed"; }


Type Literal​

{ columnWidthMode?: UiGridSizingMode; constraint: "fixedColumnCount" | "fixedRowCount"; rowHeightMode?: UiGridSizingMode; }

columnWidthMode?​

optional columnWidthMode?: UiGridSizingMode

Defaults to 'fixed'.

constraint​

constraint: "fixedColumnCount" | "fixedRowCount"

rowHeightMode?​

optional rowHeightMode?: UiGridSizingMode

The height/row equivalent of columnWidthMode. Defaults to 'fixed'.