Skip to content
Date & Time Rows preview
Rendered from the SwiftUI source on this page.

Date & Time Rows

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

Rows with date and time value pills.

Cards · SwiftUI · iOS 17

  • cards
  • swiftui

The actual source

DateRow.swift
// Date & Time Rows · syxUI · https://syxui.dev/components/list-date
// Free in any project. Keep this line and credit syxUI where a person can read it.

import SwiftUI

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

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)
    }
}

// Date row
struct DateRow: View {
    var body: some View {
        VStack(spacing: 0) {
            HStack { Image(systemName: "calendar").font(.system(size: 15)).foregroundStyle(.red); Text("Date").font(.system(size: 15)); Spacer(); Text("Jul 24, 2026").font(.system(size: 15, weight: .medium)).foregroundStyle(listBlue).padding(.horizontal, 10).padding(.vertical, 5).background(listBlue.opacity(0.1), in: RoundedRectangle(cornerRadius: 8)) }.padding(.vertical, 9)
            Divider()
            HStack { Image(systemName: "clock").font(.system(size: 15)).foregroundStyle(.orange); Text("Time").font(.system(size: 15)); Spacer(); Text("2:30 PM").font(.system(size: 15, weight: .medium)).foregroundStyle(listBlue).padding(.horizontal, 10).padding(.vertical, 5).background(listBlue.opacity(0.1), in: RoundedRectangle(cornerRadius: 8)) }.padding(.vertical, 9)
        }.formaCard(14).frame(width: 320)
    }
}
iOS 17 · No dependencies

Dependencies

SwiftUI
No external dependencies

Requires iOS 17