screens/DSDashboardScreen

DSDashboardScreen

screens
since v2.0

Composable dashboard screen with a greeting header, KPI metric row, line/bar chart, activity feed, and quick-action buttons.

iOS 17+macOS 14+

Purpose

App home screens, analytics dashboards, and admin overview pages.

Props

PropTypeDefaultDescription
userreqDSUserLogged-in user for the greeting.
metricsreq[DSMetric]KPI cards row (value, label, change %).
chartDatareq[DSChartDataPoint]Data for the main chart.
recentActivityreq[DSActivityItem]Feed items below the chart.
quickActions[DSQuickAction][]Shortcut buttons in the header.

Examples

Business dashboard

Revenue + users dashboard.

swift
DSDashboardScreen(
    user: currentUser,
    metrics: [
        DSMetric(label: "Revenue",  value: "$48.2K", change: +0.12),
        DSMetric(label: "Users",    value: "2,847",  change: +0.08),
        DSMetric(label: "Churn",    value: "2.1%",   change: -0.03),
        DSMetric(label: "MRR",      value: "$9.6K",  change: +0.21),
    ],
    chartData: viewModel.weeklyRevenue,
    recentActivity: viewModel.recentActivity,
    quickActions: [
        DSQuickAction(label: "New project", icon: "plus",         action: { navigate(.newProject) }),
        DSQuickAction(label: "Reports",     icon: "chart.bar",    action: { navigate(.reports) }),
        DSQuickAction(label: "Team",        icon: "person.3",     action: { navigate(.team) }),
    ]
)

Related Components