layout/DSContainer

DSContainer

layout
since v1.0

Max-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

PropTypeDefaultDescription
maxWidthCGFloat960Maximum content width.
paddingCGFloatDSSpacing.xlHorizontal padding.
contentreqViewBuilderโ€”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) }
    }
}

Related Components