screens/DSDashboardScreen
DSDashboardScreen
screensComposable 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.
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
| Prop | Type | Default | Description |
|---|---|---|---|
| userreq | DSUser | — | Logged-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) }),
]
)