Skip to content
Task Card preview
Rendered from the SwiftUI source on this page.

Task Card

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

A to-do card with a checkbox, priority tag and due date.

Cards · SwiftUI · iOS 17

  • cards
  • swiftui

The actual source

TaskCard.swift
// Task Card · syxUI · https://syxui.dev/components/card-task
// 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)
    }
}

// Task card
struct TaskCard: View {
    let orange = Color(red: 0.98, green: 0.55, blue: 0.10)
    var body: some View {
        HStack(spacing: 12) {
            Image(systemName: "circle").font(.system(size: 22)).foregroundStyle(.secondary.opacity(0.5))
            VStack(alignment: .leading, spacing: 5) {
                Text("Finish Q3 design review").font(.system(size: 15, weight: .medium))
                HStack(spacing: 8) {
                    Text("High").font(.system(size: 11, weight: .semibold)).foregroundStyle(orange).padding(.horizontal, 7).padding(.vertical, 2).background(orange.opacity(0.14), in: Capsule())
                    Label("Today", systemImage: "calendar").font(.system(size: 12)).foregroundStyle(.secondary)
                }
            }
            Spacer(minLength: 0)
        }.formaCard(14).frame(width: 300)
    }
}
iOS 17 · No dependencies

Dependencies

SwiftUI
No external dependencies

Requires iOS 17