---
title: "gridCellUnsizedAxes(_:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/view/gridcellunsizedaxes(_:)"
---

# gridCellUnsizedAxes(_:)

Asks grid layouts not to offer the view extra size in the specified axes.

## Declaration

```swift
nonisolated func gridCellUnsizedAxes(_ axes: Axis.Set) -> some View

```

## Parameters

- `axes`: The dimensions in which the grid shouldn’t offer the view a share of any available space. This prevents a flexible view like a doc://com.apple.SwiftUI/documentation/SwiftUI/Spacer, doc://com.apple.SwiftUI/documentation/SwiftUI/Divider, or doc://com.apple.SwiftUI/documentation/SwiftUI/Color from defining the size of a row or column.

## Return Value

Return Value A view that doesn’t ask an enclosing grid for extra size in one or more axes.

## Discussion

Discussion Use this modifier to prevent a flexible view from taking more space on the specified axes than the other cells in a row or column require. For example, consider the following Grid that places a Divider between two rows of content: Grid {     GridRow {         Text("Hello")         Image(systemName: "globe")     }     Divider()     GridRow {         Image(systemName: "hand.wave")         Text("World")     } } The text and images all have ideal widths for their content. However, because a divider takes as much space as its parent offers, the grid fills the width of the display, expanding all the other cells to match:

You can prevent the grid from giving the divider more width than the other cells require by adding the modifier with the Axis.horizontal parameter: Divider()     .gridCellUnsizedAxes(.horizontal) This restores the grid to the width that it would have without the divider:

## See Also

### Statically arranging views in two dimensions

- [Grid](swiftui/grid.md)
- [GridRow](swiftui/gridrow.md)
- [gridCellColumns(_:)](swiftui/view/gridcellcolumns(_:).md)
- [gridCellAnchor(_:)](swiftui/view/gridcellanchor(_:).md)
- [gridColumnAlignment(_:)](swiftui/view/gridcolumnalignment(_:).md)
