Screen · Productivity
Dashboard SwiftUI Screen
A SwiftUI dashboard with cohesive cards and charts that you can restyle around your own data. Use it as a home screen or an analytics view, and swap in your metrics.
A dashboard home: a greeting that collapses into the nav bar, metric tiles with rolling values and sparklines, a scrubbable Swift Charts card with a range picker, activity rows with swipe actions and a designed pull-to-refresh.
- SwiftUI
- iOS 17.0+
- dashboard-screen
$199 once, every piece included. See how installing works · Sign in
01
What's included
SwiftUI source you own, built on Apple frameworks only.
- A greeting that collapses into the navigation bar
- Metric tiles with rolling values and sparklines
- A Swift Charts card you scrub, with a range picker
- Activity rows with swipe actions and a designed pull to refresh
- Driven by one
DashboardModel
In the Build Kit
Neon (style). Your agent builds around this screen in the same design.
Used in
Productivity App (template)
02
Implementation notes
How it behaves, what it handles, and the decisions behind it.
Everything is driven by a DashboardModel: mutate its properties and the screen animates. The greeting collapses into the navigation bar as you scroll, metric tiles roll to new values with numericText over sparklines that draw on first appear, and the main chart scrubs under the finger with a haptic per sample while the header shows the scrubbed value and date. The range picker slides its selection with matchedGeometryEffect and re-draws the chart. Activity rows swipe to reveal archive and delete; past 62% of the width, delete takes the whole reveal and a release commits it. Pulling down draws a ring that fills with the pull, spins while refresh runs and ends on a check with a success haptic. Sections stagger in on first appear.
Notes
- Inside a tab or another
NavigationStack, passwrapsInNavigationStack: falseso the screen uses the enclosing stack instead of its own. The Productivity App template embeds it this way. - Scrubbing uses
chartXSelection; the nearest sample is resolved on the model side, so irregular series work..selectionfires when the nearest sample changes, never per frame. - Pull-to-refresh arms at 84 pt with a rigid tick. On iOS 18 it fires when the finger lifts (
onScrollPhaseChange); on iOS 17 it fires as the threshold is crossed. - Swipe rows claim only mostly horizontal drags, so vertical scrolling is unaffected; only one row is open at a time and tapping an open row closes it. Rows expose archive and delete as VoiceOver custom actions.
- Ranges without points are hidden from the picker.
DashboardMetric.Formathandles compact numbers, currency and percent. - Reduce Motion drops the reveal offsets, chart cross-fades and springs; values still roll.
DashboardScreenExampleat the end ofDashboardScreen.swiftis the screen shown in the preview; copy it as a starting point.
Theming
- Reads
SPThemefrom@Environment(\.spTheme)and requires thedesign-systemitem. Set.environment(\.spTheme, YourTheme())above the screen to re-skin it. - Color:
bgfor the ground,surfacefor cards and rows,accentfor the chart, sparklines, refresh ring and row icons (override withtint),successanddangerfor change pills and delete,fillfor the range track and ring,separatorfor grid lines and dividers, and the three text roles. - Type, spacing and radius come from
type,spaceandradius: cards useradius.lgwithspSurface(.e1), the greeting usestype.display, tick and pill labels usetype.caption. - Motion: row removal and the refresh inset use
motion.hero, the range picker usesmotion.standard. Gesture release springs, the staggered reveal and value rolls keep their designed timings.
03
Keep building
Pieces that work well next to this one.