layout/DSContainer

DSContainer

layout
since 0.1.0

Max-width content wrapper with automatic horizontal padding.

iOS 17+macOS 14+watchOS 10+tvOS 17+visionOS 1+

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
maxWidthDSContainerWidth.lg.sm (480), .md (640), .lg (768), .xl (1024) or .full.
paddingCGFloatDSSpacing.mdHorizontal padding.
contentreq@ViewBuilder () -> Contentโ€”Container content.

Examples

Page container

Readable width for a settings page on iPad and Mac.

swift
DSContainer(maxWidth: .md) {
    DSSection(title: "Account") {
        DSListRow(title: "Profile", leadingIcon: "person") { navigate(.profile) }
        DSListRow(title: "Security", leadingIcon: "lock") { navigate(.security) }
    }
}

Related Components