---
title: Section
framework: swiftui
role: symbol
role_heading: Structure
path: swiftui/section
---

# Section

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

## Declaration

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

## Mentioned in

Grouping data with lazy stack views Displaying data in lists Populating SwiftUI menus with adaptive controls Suggesting search terms

## Overview

Overview Use Section instances in views like List, Picker, and 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 that uses the 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:)](swiftui/section/init(content:).md)
- [init(_:content:)](swiftui/section/init(_:content:).md)

### Adding headers and footers

- [init(content:header:)](swiftui/section/init(content:header:).md)
- [init(content:footer:)](swiftui/section/init(content:footer:).md)
- [init(content:header:footer:)](swiftui/section/init(content:header:footer:).md)

### Controlling collapsibility

- [init(_:isExpanded:content:)](swiftui/section/init(_:isexpanded:content:).md)
- [init(isExpanded:content:header:)](swiftui/section/init(isexpanded:content:header:).md)

### Deprecated symbols

- [init(header:content:)](swiftui/section/init(header:content:).md)
- [init(footer:content:)](swiftui/section/init(footer:content:).md)
- [init(header:footer:content:)](swiftui/section/init(header:footer:content:).md)
- [collapsible(_:)](swiftui/section/collapsible(_:).md)

## Relationships

### Conforms To

- [Copyable](swift/copyable.md)
- [Escapable](swift/escapable.md)
- [TableRowContent](swiftui/tablerowcontent.md)
- [View](swiftui/view.md)

## See Also

### Organizing views into sections

- [SectionCollection](swiftui/sectioncollection.md)
- [SectionConfiguration](swiftui/sectionconfiguration.md)
