Quick answer: Godot GridContainer showing all children on one row regardless of column count? GridContainer is fixed-column — it doesn’t auto-wrap on width. For responsive layout, switch to FlowContainer.

An inventory grid built with GridContainer ignores width changes; on narrow viewports items run off the edge instead of wrapping.

Grid vs Flow

GridContainer takes columns as a hard setting. Children flow into N columns, then wrap to the next row. Width changes don’t adjust the column count.

FlowContainer for Responsive

Godot 4.3+ ships HFlowContainer / VFlowContainer. They wrap based on available width / height. Drop-in replacement for “auto-wrap rows”.

Dynamic Column Count

func _on_resized():
    grid.columns = floor(size.x / item_width)

Recompute columns based on viewport width. Cheap; runs on resize only.

Min Size Per Child

Each child’s custom_minimum_size determines the row height / column width. Inconsistent min sizes cause uneven layout. Standardize per design system.

Verifying

Resizing the window wraps items into new rows automatically. No items clip outside the container.

“GridContainer is fixed-column. Use FlowContainer for wrap-on-width.”

On older Godot, write a tiny helper that switches columns on resize — bridges to the FlowContainer behavior until you can upgrade.