
Date Picker Sheet
From syxUI — written for both platforms, not translated between them.
A calendar date-picker sheet.
Cards · SwiftUI · iOS 17
- cards
- swiftui
The actual source
DatePickerSheet.swift
// Date Picker Sheet · syxUI · https://syxui.dev/components/sheet-date
// Free in any project. Keep this line and credit syxUI where a person can read it.
import SwiftUI
let shBlue = Color(red: 0.0, green: 0.47, blue: 1.0)
func shCard<C: View>(_ w: CGFloat, radius: CGFloat = 18, @ViewBuilder _ c: () -> C) -> some View {
c().frame(width: w).background(Color(.systemBackground), in: RoundedRectangle(cornerRadius: radius, style: .continuous)).overlay(RoundedRectangle(cornerRadius: radius, style: .continuous).stroke(Color.primary.opacity(0.07), lineWidth: 1)).shadow(color: .black.opacity(0.05), radius: 12, y: 5)
}
// Date picker sheet
struct DatePickerSheet: View {
var body: some View {
shCard(320, radius: 22) {
VStack(spacing: 12) {
HStack { Text("Select Date").font(.system(size: 16, weight: .semibold)); Spacer(); Text("July 2026").font(.system(size: 14)).foregroundStyle(.secondary) }
HStack(spacing: 0) { ForEach(Array(["S", "M", "T", "W", "T", "F", "S"].enumerated()), id: \.offset) { _, d in Text(d).font(.system(size: 11)).foregroundStyle(.secondary).frame(maxWidth: .infinity) } }
LazyVGrid(columns: Array(repeating: GridItem(.flexible()), count: 7), spacing: 6) { ForEach(1...14, id: \.self) { day in Text("\(day)").font(.system(size: 13, weight: day == 8 ? .bold : .regular)).foregroundStyle(day == 8 ? .white : .primary).frame(width: 30, height: 30).background(day == 8 ? shBlue : .clear, in: Circle()) } }
Text("Confirm").font(.system(size: 16, weight: .semibold)).foregroundStyle(.white).frame(maxWidth: .infinity).padding(.vertical, 12).background(shBlue, in: RoundedRectangle(cornerRadius: 12, style: .continuous))
}.padding(18)
}
}
}
iOS 17 · No dependencies
Dependencies
- SwiftUI
- No external dependencies
Requires iOS 17


