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

Duration

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

An hours / minutes duration picker.

Inputs · SwiftUI · iOS 17

  • inputs
  • swiftui

The actual source

PickerDuration.swift
// Duration · syxUI · https://syxui.dev/components/picker-duration
// Free in any project. Keep this line and credit syxUI where a person can read it.

import SwiftUI

struct PickerDuration: View { var body: some View { HStack(spacing: 0) { VStack(spacing: 6) { Text("1").font(.system(size: 22, weight: .semibold)); Text("hours").font(.system(size: 11)).foregroundStyle(.secondary) }.frame(maxWidth: .infinity); Text(":").font(.system(size: 22, weight: .semibold)).foregroundStyle(.secondary); VStack(spacing: 6) { Text("30").font(.system(size: 22, weight: .semibold)); Text("min").font(.system(size: 11)).foregroundStyle(.secondary) }.frame(maxWidth: .infinity) }.padding(.vertical, 16).frame(width: 220).overlay(RoundedRectangle(cornerRadius: 14, style: .continuous).stroke(Color.primary.opacity(0.1))) } }
iOS 17 · No dependencies

Dependencies

SwiftUI
No external dependencies

Requires iOS 17