Overload 1: Fill container
Overload 2: Grid subdivision
Overload 3: Fractional sizing
Support
Usage
Fill the container horizontally
Grid layout — 3 columns with spacing
Span multiple columns
Fractional sizing — 80% of container width
Horizontal scroll with fixed-width cards
Notes
The nearest container is the closest ancestorScrollView, List, or NavigationStack. The modifier sizes the component relative to that container’s visible area, not the full scrollable content.
The grid subdivision form calculates the cell width as: (containerWidth - (count - 1) * spacing) / count * span + (span - 1) * spacing.