How do you change the size of a ProgressView in SwiftUI?

← Swift answers

ProgressView has no size option. Scale a spinner with .scaleEffect, control a bar's width with .frame(width:), and use a custom ProgressViewStyle to change a bar's height.

// Spinner
ProgressView()
    .scaleEffect(1.8)
 
// Bar width
ProgressView(value: 0.6)
    .frame(width: 200)
 
// Thicker bar with a custom style
struct ThickBar: ProgressViewStyle {
    func makeBody(configuration: Configuration) -> some View {
        let fraction = configuration.fractionCompleted ?? 0
        GeometryReader { geo in
            ZStack(alignment: .leading) {
                Capsule().fill(.quaternary)
                Capsule().fill(.tint).frame(width: geo.size.width * fraction)
            }
        }
        .frame(height: 12)
    }
}
 
ProgressView(value: 0.6).progressViewStyle(ThickBar())

scaleEffect scales the drawn view without changing its layout size, so add padding if a scaled spinner overlaps its neighbors.

Related questions

Start debugging smarter today

Try Bugsee for free — no commitments, no hidden fees.

Free sign upLive demoNo credit card required