<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 18.0.0 -",
    "visionOS: 2.0.0 -",
    "watchOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/SectionConfiguration",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI20SectionConfigurationV"
  },
  "title" : "SectionConfiguration"
}
-->

# SectionConfiguration

Specifies the contents of a section.

```
struct SectionConfiguration
```

## Overview

A `SectionConfiguration` includes the content of the section, as well as
its header and footer.

A `SectionConfiguration` can represent either an explicit section,
or groups of sibling views that are not explicitly wrapped in a section.

Notably, the `header`, `footer` and `content` properties of a
`SectionConfiguration` are all `SubviewsCollection`s as they can be made up
of multiple subviews. That means in most cases, the subviews collection
should be treated as a collection (either indexed into, or used with a
`ForEach`), or the subviews collection should be wrapped in a container
view, like a layout, or other custom container:

```
PinboardSectionsLayout {
    ForEach(sections: content) { section in
        VStack {
            HStack { section.header }
            section.content
            HStack { section.footer }
        }
    }
}
```

Here, we want to create one view for `PinboardSectionsLayout` to place per
section in content. To do that, we surround the `ForEach` body in another
container, a `VStack` layout, ensuring the different subviews of
section.content are treated as a single view by the surrounding layout.
Additionally, surrounding the header and footer in an `HStack` layout
avoids vertically stacking subviews of the header and footer
which we want visually grouped together.

## Topics

### Structures

[`struct Actions`](/documentation/SwiftUI/SectionConfiguration/Actions-swift.struct)

The type-erased actions of a section.

[`struct ID`](/documentation/SwiftUI/SectionConfiguration/ID-swift.struct)

A unique identifier for a section.

### Instance Properties

[`var actions: SectionConfiguration.Actions`](/documentation/SwiftUI/SectionConfiguration/actions-swift.property)

Custom actions associated with a section.

[`var containerValues: ContainerValues`](/documentation/SwiftUI/SectionConfiguration/containerValues)

The container values associated with the given section.

[`var content: SubviewsCollection`](/documentation/SwiftUI/SectionConfiguration/content)

The contents of the section body.

[`var footer: SubviewsCollection`](/documentation/SwiftUI/SectionConfiguration/footer)

The contents of the section footer.

[`var header: SubviewsCollection`](/documentation/SwiftUI/SectionConfiguration/header)

The contents of the section header.

[`var id: SectionConfiguration.ID`](/documentation/SwiftUI/SectionConfiguration/id-swift.property)

A unique identifier representing the section.

## Relationships

### Conforms To

[`Identifiable`](/documentation/Swift/Identifiable)

---

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)