Skip to content
Order Tracking preview
Rendered from the SwiftUI source on this page.

Order Tracking

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

A delivery-status card with a step progress tracker.

Cards · SwiftUI · iOS 17

  • cards
  • swiftui

The actual source

OrderTrackingCard.swift
// Order Tracking · syxUI · https://syxui.dev/components/card-order
// 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)
    }
}

// Order tracking card
struct OrderTrackingCard: View {
    let green = Color(red: 0.16, green: 0.66, blue: 0.40)
    var body: some View {
        VStack(alignment: .leading, spacing: 12) {
            HStack {
                VStack(alignment: .leading, spacing: 2) {
                    Text("Out for delivery").font(.system(size: 15, weight: .semibold))
                    Text("Arrives by 5:30 PM").font(.system(size: 13)).foregroundStyle(.secondary)
                }
                Spacer()
                Image(systemName: "shippingbox.fill").font(.system(size: 20)).foregroundStyle(green)
            }
            HStack(spacing: 0) {
                ForEach(0..<4, id: \.self) { i in
                    Circle().fill(i <= 2 ? green : Color.primary.opacity(0.15)).frame(width: 10, height: 10)
                    if i < 3 { Rectangle().fill(i < 2 ? green : Color.primary.opacity(0.15)).frame(height: 2) }
                }
            }
            HStack {
                Text("Ordered").font(.system(size: 11)).foregroundStyle(.secondary)
                Spacer()
                Text("Shipped").font(.system(size: 11)).foregroundStyle(.secondary)
                Spacer()
                Text("Delivered").font(.system(size: 11)).foregroundStyle(.secondary)
            }
        }.formaCard(14).frame(width: 300)
    }
}
iOS 17 · No dependencies

Dependencies

SwiftUI
No external dependencies

Requires iOS 17