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.7.1"), .package(url: "https://github.com/NerdSnipe-Inc/DesignFoundationPro", from: "2.3.0"), // private: access granted after purchase ], targets: [ .target(name: "YourApp", dependencies: [ .product(name: "DesignFoundation", package: "design-foundation"), .product(name: "DesignFoundationPro", package: "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) |
| DFPMRootView | Project management workspace — boards, lists, timeline, team (composition) |
| DFEcommerceRootView | Seller/store workspace — orders, products, revenue (composition) |
| DFAnalyticsRootView | Metrics dashboard — overview, events, revenue, users (composition) |
| DFAIChatRootView | Thread-first AI assistant workspace (composition) |
| DFOnboardingFlow | Multi-step sign-up / onboarding wizard (composition) |
| DFBookingRootView | Service-booking app — schedule and confirm appointments (composition) |
| DFFoodRootView | Restaurant ordering app — browse, menu, item detail (composition) |
| DFNewsRootView | News/article reading app (composition) |
DFCRMRootView( deals: viewModel.deals, contacts: viewModel.contacts ) .environment(\.dfTheme, .workspace) .environment(\.dfUseDesktopDensity, DFLayout.useDesktopLayout(horizontalSizeClass: sizeClass)) .dfToastHost()
See all 12 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