<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/listSectionMargins(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE18listSectionMarginsyQrAA4EdgeO3SetV_14CoreFoundation7CGFloatVSgtF"
  },
  "title" : "listSectionMargins(_:_:)"
}
-->

# listSectionMargins(_:_:)

Set the section margins for the specific edges.

```
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 [`all`](/documentation/SwiftUI/Edge/Set/all).

`length`

An amount, given in points, to pad section on the
specified edges.

## Return Value

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

## 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`](/documentation/SwiftUI/Edge/Set), or by specifying an
<doc://com.apple.documentation/documentation/Swift/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.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)