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

Upload Progress

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

A media upload row with a progress bar.

Cards · SwiftUI · iOS 17

  • cards
  • swiftui

The actual source

UploadCard.swift
// Upload Progress · syxUI · https://syxui.dev/components/media2-upload
// Free in any project. Keep this line and credit syxUI where a person can read it.

import SwiftUI

extension View {
    func formaCard(_ pad: CGFloat = 18) -> some View {
        self.padding(pad)
            .background(Color(.systemBackground), in: RoundedRectangle(cornerRadius: 20, style: .continuous))
            .overlay(RoundedRectangle(cornerRadius: 20, style: .continuous).stroke(Color.primary.opacity(0.06), lineWidth: 1))
            .shadow(color: .black.opacity(0.05), radius: 14, x: 0, y: 6)
    }
}

// Upload progress card
struct UploadCard: View {
    var body: some View {
        VStack(alignment: .leading, spacing: 12) {
            HStack(spacing: 12) {
                RoundedRectangle(cornerRadius: 8, style: .continuous).fill(Color.primary.opacity(0.06)).frame(width: 44, height: 44).overlay(Image(systemName: "photo.fill").font(.system(size: 18)).foregroundStyle(.secondary))
                VStack(alignment: .leading, spacing: 2) { Text("beach_sunset.jpg").font(.system(size: 14, weight: .medium)); Text("Uploading… 68%").font(.system(size: 12)).foregroundStyle(.secondary) }
                Spacer()
                Image(systemName: "xmark.circle.fill").font(.system(size: 18)).foregroundStyle(.secondary)
            }
            GeometryReader { g in ZStack(alignment: .leading) { Capsule().fill(Color.primary.opacity(0.08)).frame(height: 6); Capsule().fill(Color(red: 0.0, green: 0.47, blue: 1.0)).frame(width: g.size.width * 0.68, height: 6) } }.frame(height: 6)
        }.formaCard(16).frame(width: 320)
    }
}
iOS 17 · No dependencies

Dependencies

SwiftUI
No external dependencies

Requires iOS 17