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

# listSectionMargins(_:_:)

Set the section margins for the specific edges.

## Declaration

```swift
nonisolated func listSectionMargins(_ edges: Edge.Set = .all, _ length: CGFloat?) -> some View

```

## Parameters

- `edges`: The set of edges to pad for sections in this view. The default is doc://com.apple.SwiftUI/documentation/SwiftUI/Edge/Set/all.
- `length`: An amount, given in points, to pad section on the specified edges.

## Return Value

Return Value A view in which the margins of list sections are set to the specified amount on the specified edges.

## Discussion

Discussion Use this modifier on a list section to set customize its margins. Indicate the edges to set the margin of by naming either a single value from  Edge.Set, or by specifying an OptionSet that contains edge values. Margins for the other edges remain unchanged. The default section margins are based on the list style, list section spacing and content margins of the list. Using this modifier overrides these default values completely. For sections that have headers or footers, the section margins are applied around these.

## See Also

### Configuring a list’s layout

- [listRowInsets(_:)](swiftui/view/listrowinsets(_:).md)
- [listRowInsets(_:_:)](swiftui/view/listrowinsets(_:_:).md)
- [defaultMinListRowHeight](swiftui/environmentvalues/defaultminlistrowheight.md)
- [defaultMinListHeaderHeight](swiftui/environmentvalues/defaultminlistheaderheight.md)
- [listRowSpacing(_:)](swiftui/view/listrowspacing(_:).md)
- [listSectionSpacing(_:)](swiftui/view/listsectionspacing(_:).md)
- [ListSectionSpacing](swiftui/listsectionspacing.md)
