layout/DSContainer
DSContainer
layoutMax-width content wrapper with automatic horizontal padding.
iOS 17+macOS 14+
Purpose
Constrain content width on large screens (macOS, iPad landscape).
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| maxWidth | CGFloat | 960 | Maximum content width. |
| padding | CGFloat | DSSpacing.xl | Horizontal padding. |
| contentreq | ViewBuilder | โ | Container content. |
Examples
Page container
Constrained layout for a settings page.
swift
DSContainer(maxWidth: 720) {
DSSection("Account") {
DSSettingsRow(icon: "person", title: "Profile") { navigate(.profile) }
DSSettingsRow(icon: "lock", title: "Security") { navigate(.security) }
}
}