Skip to content
Week Strip preview
Rendered from the SwiftUI source on this page.

Week Strip

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

A horizontal week selector.

Inputs · SwiftUI · iOS 17

  • inputs
  • swiftui

The actual source

PickerWeek.swift
// Week Strip · syxUI · https://syxui.dev/components/picker-week
// Free in any project. Keep this line and credit syxUI where a person can read it.

import SwiftUI

let pkBlue = 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)
    }
}

struct PickerWeek: View { var body: some View { VStack(alignment: .leading, spacing: 12) { HStack { Text("This week").font(.system(size: 15, weight: .semibold)); Spacer(); Text("Jul 2026").font(.system(size: 13)).foregroundStyle(.secondary) }; HStack(spacing: 6) { ForEach(Array([("M", "22"), ("T", "23"), ("W", "24"), ("T", "25"), ("F", "26"), ("S", "27"), ("S", "28")].enumerated()), id: \.offset) { i, d in VStack(spacing: 5) { Text(d.0).font(.system(size: 11)).foregroundStyle(.secondary); Text(d.1).font(.system(size: 14, weight: i == 2 ? .bold : .regular)).foregroundStyle(i == 2 ? .white : .primary).frame(width: 32, height: 32).background { if i == 2 { Circle().fill(pkBlue) } } }.frame(maxWidth: .infinity) } } }.formaCard().frame(width: 320) } }
iOS 17 · No dependencies

Dependencies

SwiftUI
No external dependencies

Requires iOS 17