Integration guide · Phase 6

Theme → shell → block → screen → your data

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.

1 Theme
2 Shell
3 Block
4 Screen
5 Your data

Add both packages

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"
    ])
]
License access: Pro is not a public repository. After purchase you receive GitHub access for SPM. Questions: nerdsnipe.inc@gmail.com

Apply theme at the root

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.

Pick a shell — or a composition root

Shells are layout-only: sidebars, tabs, split views. Composition roots are full reference apps already wired — faster if your product matches a vertical.

Shell / rootUse when
DFAdaptiveShellTabs on phone, sidebar on iPad/Mac
DFThreeColumnShellFolder sidebar + list + detail
DFDocumentsRootViewNotes / knowledge app (composition)
DFCRMRootViewSales pipeline workspace (composition)
DFSocialAppShellFeed + profile consumer app (composition)
DFSettingsRootViewAccount & 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.

Compose blocks

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
    ))
}

Use reference screens

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) }
    )
)

Wire your data

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

Three ways in — pick your depth

~5 minutes
One block
Theme at root → drop DFSignInBlock or DFStatCardBlock → pass Configuration callbacks.
~10 minutes
One screen
Theme + density → embed DFSettingsSecurityScreen or DFAIChatThreadScreen in your navigation stack.
~15 minutes
Composition root
Instantiate 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.

Integration checklist