Skip to content
Month / Year preview
Rendered from the SwiftUI source on this page.

Month / Year

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

A month-year navigator.

Inputs · SwiftUI · iOS 17

  • inputs
  • swiftui

The actual source

PickerMonthYear.swift
// Month / Year · syxUI · https://syxui.dev/components/picker-month-year
// 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)

struct PickerMonthYear: View { var body: some View { HStack { Image(systemName: "chevron.left").font(.system(size: 15, weight: .semibold)).foregroundStyle(pkBlue); Spacer(); Text("October 2026").font(.system(size: 17, weight: .semibold)); Spacer(); Image(systemName: "chevron.right").font(.system(size: 15, weight: .semibold)).foregroundStyle(pkBlue) }.padding(.horizontal, 16).padding(.vertical, 12).frame(width: 280).background(Color.primary.opacity(0.04), in: RoundedRectangle(cornerRadius: 12, style: .continuous)) } }
iOS 17 · No dependencies

Dependencies

SwiftUI
No external dependencies

Requires iOS 17