Components

Empty state

Nothing here yet: an illustration from shapes, a line of copy and one action. Built in all 5 Effect UI styles, in light and dark mode.

Empty state in Prism, light mode
Empty state in Prism, dark mode
Prism ProLiquid Glass on living colour.
Empty state in Ledger, light mode
Empty state in Ledger, dark mode
Ledger FreeCalm, precise, trustworthy.
Empty state in Bounce, light mode
Empty state in Bounce, dark mode
Bounce ProChunky, tactile, joyful.
Empty state in Folio, light mode
Empty state in Folio, dark mode
Folio ProEditorial and literary.
Empty state in Bloom, light mode
Empty state in Bloom, dark mode
Bloom ProSoft, organic, calming.

Source: Ledger

EmptyStateView.swift in the free Ledger style. It needs Ledger's Theme.swift, which comes with the style: join early access on the home page and it's emailed to you.

import SwiftUI

struct EmptyStateView: View {
    var body: some View {
        ScrollView {
            VStack(alignment: .leading, spacing: Theme.Space.xxl) {
                titleBar
                BlankLedgerFigure()
                message
            }
            .padding(.horizontal, Theme.Space.margin)
            .padding(.top, Theme.Space.sm)
            .padding(.bottom, Theme.Space.xl)
        }
        .scrollIndicators(.hidden)
        .paperBackground()
        .safeAreaInset(edge: .bottom) {
            BottomActionBar {
                Button("Add a recurring payment") {}
                    .buttonStyle(.ledgerPrimary)
                Button("How Tilde finds them") {}
                    .buttonStyle(TextButtonStyle(color: Theme.onSurfaceVariant))
            }
        }
    }

    private var titleBar: some View {
        VStack(alignment: .leading, spacing: Theme.Space.xl) {
            HStack {
                IconButton(symbol: "chevron.left")
                Spacer()
                IconButton(symbol: "plus")
            }
            ScreenHeader(eyebrow: "Bills and subscriptions", title: "Recurring") {
                Text("0 of 0")
                    .ledgerType(.bodySm)
                    .monospacedDigit()
                    .foregroundStyle(Theme.onSurfaceMuted)
            }
        }
    }

    private var message: some View {
        VStack(alignment: .leading, spacing: Theme.Space.md) {
            Text("No recurring payments yet")
                .ledgerType(.headlineLg)
                .foregroundStyle(Theme.onSurface)
                .fixedSize(horizontal: false, vertical: true)
            Text("Tilde lists a bill or subscription once it sees two payments to the same place. That usually takes about five weeks. You can add one yourself in the meantime.")
                .ledgerType(.bodyMd)
                .foregroundStyle(Theme.onSurfaceVariant)
                .fixedSize(horizontal: false, vertical: true)
            Text("Last checked 2h ago · 48 transactions read")
                .ledgerType(.bodySm)
                .monospacedDigit()
                .foregroundStyle(Theme.onSurfaceMuted)
                .padding(.top, Theme.Space.xs)
        }
    }
}

// MARK: - Figure

/// A blank ledger page: ruled rows waiting for entries, drawn in ink and rules only.
private struct BlankLedgerFigure: View {
    private let rows: [(date: String, opacity: Double)] = [
        ("DEC 1", 1), ("DEC 4", 0.6), ("DEC 9", 0.3),
    ]

    var body: some View {
        VStack(alignment: .leading, spacing: 0) {
            HStack(alignment: .center) {
                VStack(alignment: .leading, spacing: Theme.Space.sm) {
                    MicroLabel("Upcoming · December")
                    placeholderBar(width: 96, height: 8)
                }
                Spacer()
                SymbolTile(symbol: "arrow.triangle.2.circlepath", size: 40)
            }
            .padding(.bottom, Theme.Space.md)

            Hairline(strong: true)

            ForEach(rows.indices, id: \.self) { i in
                row(date: rows[i].date)
                    .opacity(rows[i].opacity)
                if i < rows.count - 1 {
                    Hairline().opacity(rows[i].opacity)
                }
            }
        }
        .ledgerCard()
        .accessibilityHidden(true)
    }

    private func row(date: String) -> some View {
        HStack(spacing: Theme.Space.md) {
            RoundedRectangle(cornerRadius: Theme.Radius.tile, style: .continuous)
                .strokeBorder(Theme.onSurfaceMuted, style: StrokeStyle(lineWidth: 0.75, dash: [2, 3]))
                .frame(width: 32, height: 32)
            VStack(alignment: .leading, spacing: Theme.Space.sm) {
                placeholderBar(width: 112, height: 6)
                Text(date)
                    .ledgerType(.labelSm)
                    .monospacedDigit()
                    .foregroundStyle(Theme.onSurfaceMuted)
            }
            Spacer()
            Text("$\u{2014}.\u{2014}\u{2014}")
                .ledgerType(.numeralMd)
                .foregroundStyle(Theme.onSurfaceMuted)
        }
        .frame(height: Theme.Space.rowHeight)
    }

    private func placeholderBar(width: CGFloat, height: CGFloat) -> some View {
        RoundedRectangle(cornerRadius: 2, style: .continuous)
            .fill(Theme.rule)
            .frame(width: width, height: height)
    }
}

#Preview("Light") {
    EmptyStateView()
}

#Preview("Dark") {
    EmptyStateView().preferredColorScheme(.dark)
}

More screens