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

Progress Steps

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

A labeled checkout progress indicator.

Navigation · SwiftUI · iOS 17

  • navigation
  • swiftui

The actual source

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

import SwiftUI

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

// Labeled progress steps
struct ProgressSteps: View {
    let steps = ["Info", "Address", "Review", "Done"]
    let current = 2
    var body: some View {
        VStack(spacing: 8) {
            HStack(spacing: 6) { ForEach(0..<4, id: \.self) { i in Capsule().fill(i <= current ? navBlue : Color.primary.opacity(0.12)).frame(height: 5) } }
            HStack(spacing: 0) { ForEach(Array(steps.enumerated()), id: \.offset) { i, s in Text(s).font(.system(size: 11, weight: i == current ? .semibold : .regular)).foregroundStyle(i <= current ? Color.primary : Color.secondary).frame(maxWidth: .infinity) } }
        }.frame(width: 320)
    }
}
iOS 17 · No dependencies

Dependencies

SwiftUI
No external dependencies

Requires iOS 17