Skip to content
Download Button preview
Rendered from the SwiftUI source on this page.

Download Button

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

A download button with a progress ring.

Buttons · SwiftUI · iOS 17

  • buttons
  • swiftui

The actual source

DownloadButtonCard.swift
// Download Button · syxUI · https://syxui.dev/components/btn-download
// Free in any project. Keep this line and credit syxUI where a person can read it.

import SwiftUI

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

// Download with progress ring
struct DownloadButtonCard: View {
    var body: some View {
        HStack(spacing: 12) {
            HStack(spacing: 8) { Image(systemName: "arrow.down"); Text("Download") }.font(.system(size: 15, weight: .semibold)).foregroundStyle(.white).padding(.horizontal, 20).padding(.vertical, 11).background(btnBlue, in: Capsule())
            ZStack {
                Circle().stroke(Color.primary.opacity(0.15), lineWidth: 3).frame(width: 40, height: 40)
                Circle().trim(from: 0, to: 0.6).stroke(btnBlue, style: StrokeStyle(lineWidth: 3, lineCap: .round)).frame(width: 40, height: 40).rotationEffect(.degrees(-90))
                Text("60%").font(.system(size: 10, weight: .bold))
            }
        }
    }
}
iOS 17 · No dependencies

Dependencies

SwiftUI
No external dependencies

Requires iOS 17