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).
Interactive Reference
Live showroom
Need the full visual surface?
Screenshots do not scale well across every component, state, and variant. For the real interactive reference, import the package and launch DSShowcaseRoot().
Best for exploring:
variants, states, categories, and real app examples in one place.
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) }
}
}