The DesignFoundation workflow: apply a theme once, pick layout chrome, compose blocks and reference screens, then wire your models. Cross-platform by default — iPhone, iPad, and Mac from the same code.
Step 0
Foundation is free (MIT). Pro is a commercial license with private GitHub access after purchase.
dependencies: [ .package(url: "https://github.com/NerdSnipe-Inc/design-foundation", from: "1.1.0"), // Pro: private repo URL provided with your license ], targets: [ .target(name: "YourApp", dependencies: [ "DesignFoundation", "DesignFoundationPro" ]) ]
Step 1
One modifier at the app root themes every primitive, block, and screen below it.
import DesignFoundation import DesignFoundationPro WindowGroup { AppRootView() .environment(\.dfTheme, .workspace) // product apps // or: .dfThemePreset(.slate) }
Explore presets on the Theme Presets page. Custom brands: mutate any token on DFTheme — colors, spacing, radius, typography.
Step 2
Shells are layout-only: sidebars, tabs, split views. Composition roots are full reference apps already wired — faster if your product matches a vertical.
| Shell / root | Use when |
|---|---|
| DFAdaptiveShell | Tabs on phone, sidebar on iPad/Mac |
| DFThreeColumnShell | Folder sidebar + list + detail |
| DFDocumentsRootView | Notes / knowledge app (composition) |
| DFCRMRootView | Sales pipeline workspace (composition) |
| DFSocialAppShell | Feed + profile consumer app (composition) |
| DFSettingsRootView | Account & preferences hub (composition) |
DFCRMRootView( deals: viewModel.deals, contacts: viewModel.contacts ) .environment(\.dfTheme, .workspace) .environment(\.dfUseDesktopDensity, DFLayout.useDesktopLayout(horizontalSizeClass: sizeClass)) .dfToastHost()
See all 9 composition examples on the Pro page and in DFPlayground.
Step 3
Blocks are partial UI — stat cards, auth forms, charts, empty states. Drop them inside any shell or custom layout.
VStack(spacing: theme.spacing.lg) { DFMetricGridBlock(configuration: .init(metrics: viewModel.kpis)) DFLineChartBlock(configuration: .init( title: "Active users", data: viewModel.trend, selectedPeriod: viewModel.period, isLoading: viewModel.isLoading )) }
Step 4
Full pages with typed Configuration structs — connect closures to your view model.
DFEcommerceOrdersScreen( configuration: .init( orders: viewModel.orders, onSelectOrder: { viewModel.open($0) }, onMarkShipped: { viewModel.markShipped($0) } ) )
Step 5
Replace preview fixtures with your API models. Keep theme tokens and DesignKit colors — avoid inline hex in your app layer.
// Success feedback (toast host at root) DFToastQueue.shared.show(text: "Saved", severity: .success) // Forms: DFFormState + DFValidatedTextField (Foundation) // Pro auth blocks: usesFormValidation: true by default
Choose your path
DFSignInBlock or DFStatCardBlock → pass Configuration callbacks.DFSettingsSecurityScreen or DFAIChatThreadScreen in your navigation stack.DFCRMRootView or DFDocumentsRootView → swap initializer data for your stores.Not sure which vertical fits? Browse the Use Cases page — or see The Foundation Way for line-count comparisons.
Before you ship
.environment(\.dfTheme, .workspace) or brand preset at rootdfUseDesktopDensity on product-shaped roots.dfToastHost() on composition roots