layout/DSSection
DSSection
layoutNamed content group with an optional header, footer note, and inset background.
iOS 17+macOS 14+
Purpose
Organise forms and settings into logical named groups.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| title | String? | nil | Section heading. |
| footer | String? | nil | Explanatory footer note. |
| contentreq | ViewBuilder | โ | Section content. |
Examples
Settings sections
Two sections in a settings screen.
swift
DSSection("Notifications", footer: "Alerts only apply when the app is in the background.") {
DSToggle("Push notifications", isOn: $pushEnabled)
DSToggle("Email digest", isOn: $emailEnabled)
}
DSSection("Privacy") {
DSListRow(title: "Data & Permissions") { navigate(.privacy) }
}