Skip to content
Progress Header preview
Rendered from the SwiftUI source on this page.

Progress Header

From syxUI — written for both platforms, not translated between them.

An onboarding step header with a progress bar and skip.

Navigation · SwiftUI · iOS 17

  • navigation
  • swiftui

The actual source

HeaderProgress.swift
// Progress Header · syxUI · https://syxui.dev/components/hdr-progress
// Free in any project. Keep this line and credit syxUI where a person can read it.

import SwiftUI

let hdrBlue = Color(red: 0.0, green: 0.47, blue: 1.0)

// Progress / step header
struct HeaderProgress: View {
    var body: some View {
        VStack(alignment: .leading, spacing: 10) {
            HStack {
                Image(systemName: "chevron.left").font(.system(size: 17, weight: .semibold)).foregroundStyle(.primary)
                Spacer()
                Text("Step 2 of 4").font(.system(size: 13, weight: .medium)).foregroundStyle(.secondary)
                Spacer()
                Text("Skip").font(.system(size: 15)).foregroundStyle(hdrBlue)
            }
            GeometryReader { g in
                ZStack(alignment: .leading) {
                    Capsule().fill(Color.primary.opacity(0.1)).frame(height: 5)
                    Capsule().fill(hdrBlue).frame(width: g.size.width * 0.5, height: 5)
                }
            }.frame(height: 5)
        }.frame(width: 340)
    }
}
iOS 17 · No dependencies

Dependencies

SwiftUI
No external dependencies

Requires iOS 17