<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/Section",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI7SectionV"
  },
  "title" : "Section"
}
-->

# Section

A container view that you can use to add hierarchy within certain views.

```
struct Section<Parent, Content, Footer>
```

## Overview

Use `Section` instances in views like [`List`](/documentation/SwiftUI/List), [`Picker`](/documentation/SwiftUI/Picker), and
[`Form`](/documentation/SwiftUI/Form) to organize content into separate sections. Each section has
custom content that you provide on a per-instance basis. You can also
provide headers and footers for each section.

### Collapsible sections

Create sections that expand and collapse by using an initializer that
accepts an `isExpanded` binding. A collapsible section in a [`List`](/documentation/SwiftUI/List) that
uses the [`sidebar`](/documentation/SwiftUI/ListStyle/sidebar) style shows a disclosure indicator next to
the section’s header. Tapping on the disclosure indicator toggles the
appearance of the section’s content.

> Note: Not all contexts provide a default control to trigger collapse or
> expansion.

## Topics

### Creating a section

[`init(content:)`](/documentation/SwiftUI/Section/init(content:))

Creates a section with the provided section content.

[`init(_:content:)`](/documentation/SwiftUI/Section/init(_:content:))

Creates a section with the provided section content.

### Adding headers and footers

[`init(content:header:)`](/documentation/SwiftUI/Section/init(content:header:))

Creates a section with a header and the provided section content.

[`init(content:footer:)`](/documentation/SwiftUI/Section/init(content:footer:))

Creates a section with a footer and the provided section content.

[`init(content:header:footer:)`](/documentation/SwiftUI/Section/init(content:header:footer:))

Creates a section with a header, footer, and the provided section
content.

### Controlling collapsibility

[`init(_:isExpanded:content:)`](/documentation/SwiftUI/Section/init(_:isExpanded:content:))

Creates a section with the provided section content.

[`init(isExpanded:content:header:)`](/documentation/SwiftUI/Section/init(isExpanded:content:header:))

Creates a section with the provided section content.

### Deprecated symbols

[`init(header:content:)`](/documentation/SwiftUI/Section/init(header:content:))

Creates a section with a header and the provided section content.

[`init(footer:content:)`](/documentation/SwiftUI/Section/init(footer:content:))

Creates a section with a footer and the provided section content.

[`init(header:footer:content:)`](/documentation/SwiftUI/Section/init(header:footer:content:))

Creates a section with a header, footer, and the provided section content.

[`collapsible(_:)`](/documentation/SwiftUI/Section/collapsible(_:))

Sets whether a section can be collapsed by the user.



---

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)