Skip to main content
196

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Apple docs
FormsApple

Time field

Choose a local time with native clock or keyboard input and explicit confirmation.

Public APILumenTimeFieldApple / SwiftUISwift product: LumenUI

Apple availability

Supported native targets

Import LumenUI in the target that uses this component. iPad support follows the iOS package baseline and uses native iPad layout behavior.

iPhone · iOS 16+iPad · iPadOS 16+Mac · macOS 13+Apple Vision · visionOS 1+

Native example

Use Time field

Use a local wall-clock value rather than an epoch timestamp. Keep dates, time zones, overnight scheduling, and translated labels in the application.

Time field rendered in the iPhone simulator Lumen playground
Captured exampleiPhone simulator
swift
import LumenUI
import SwiftUI

struct MeetingTime: View {
    @State private var time: LumenTimeSelection? = nil
    var body: some View {
        LumenTimeField("Meeting time", selection: $time,
            minTime: LumenTimeSelection(hour: 8, minute: 30),
            maxTime: LumenTimeSelection(hour: 17, minute: 0))
    }
}

Reference

Public API

The primary shared and platform-specific options exposed by LumenTimeField.

APIValues or typeDefaultDescription
_ labelStringRequiredNames the time field.
selectionBinding<LumenTimeSelection?>RequiredControls confirmed hour and minute.
minTime / maxTimeLumenTimeSelection?nilInclusive same-day bounds; minimum must not exceed maximum.
placeholder / confirmLabel / dismissLabel / rangeErrorLabelStringChoose a time / Confirm / Cancel / Choose a time within the allowed rangeLocalizes empty, confirmation, cancellation and validation copy.
.environment(\.locale, ...)LocaleEnvironmentFormats the selected time with the native locale.
description / errorMessageString?nilProvides localized supporting copy or host validation.
readOnly / .disabled(...)BoolfalseBlocks editing; disabled state comes from the SwiftUI environment.

Native behavior

Design and accessibility

When to use it

Use a local wall-clock value rather than an epoch timestamp. Keep dates, time zones, overnight scheduling, and translated labels in the application.

Accessibility

Names the selected time and native dialog actions; confirmation publishes the draft, cancellation preserves the value, and disabled or read-only fields cannot open selection.

Shared component

Available on other platforms

React NativeAndroid / Compose
Apple docsSwiftUI package