Swift PiecesPro
  • Library
    Screens48Finished, designed screens for real apps.Templates10Complete apps built from the screens.Build Kit24Styles, briefs and recipes for your coding agentEverything58The whole library, with search
  • Docs
  • Pro

Library

  • Screens48
  • Templates10
  • Build Kit24
  • Everything58
  • Docs
  • Pro
  • Account
Get Swift Pieces ProFree library ↗
Swift PiecesPro

Production-ready SwiftUI screens and app templates for iOS. The pieces to build the whole app.

Library

  • Screens
  • Templates
  • Build Kit
  • Everything

Product

  • Pro
  • Your account
  • Sign in

Resources

  • Docs
  • CLI
  • MCP and agents
  • Free library

Social

  • X / Twitter
  • GitHub

SWIFTPIECES PRO

© 2026 Swift Pieces. One payment, lifetime access, per-developer commercial license.

Curated withby Saivion

LibraryScreensDashboard

Screen · Productivity

Dashboard

A home dashboard with a collapsing greeting, live metrics, a scrubbable chart and activity.

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.

SwiftUIiOS 17.0+dashboard-screen

Get Swift Pieces Pro

$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

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, pass wrapsInNavigationStack: false so 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. .selection fires 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.Format handles compact numbers, currency and percent.
  • Reduce Motion drops the reveal offsets, chart cross-fades and springs; values still roll.
  • DashboardScreenExample at the end of DashboardScreen.swift is the screen shown in the preview; copy it as a starting point.

Theming

  • Reads SPTheme from @Environment(\.spTheme) and requires the design-system item. Set .environment(\.spTheme, YourTheme()) above the screen to re-skin it.
  • Color: bg for the ground, surface for cards and rows, accent for the chart, sparklines, refresh ring and row icons (override with tint), success and danger for change pills and delete, fill for the range track and ring, separator for grid lines and dividers, and the three text roles.
  • Type, spacing and radius come from type, space and radius: cards use radius.lg with spSurface(.e1), the greeting uses type.display, tick and pill labels use type.caption.
  • Motion: row removal and the refresh inset use motion.hero, the range picker uses motion.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.

Screen · Account

Settings

A settings home with a collapsing profile header, grouped rows, toggles and sign out.

Screen · Finance

Budget

A budget overview around a ring you can scrub, with category limits and period switching.

Screen · Productivity

Focus

A focus session with a dial you drag to set minutes and a ring that drains as you work.