Skip to main content
161

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Apple docs
FormsApple

Date field

Select a native date with bounds and validation context.

Public APILumenDateFieldApple / 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 Date field

Use for native date input that needs Lumen supporting and validation context. SwiftUI also supports time and combined date-time input.

Date field rendered in the iPhone simulator Lumen playground
Verified runtime captureiPhone simulator
swift
LumenDateField(
    "Release date",
    selection: $releaseDate,
    components: .dateAndTime,
    bounds: .from(.now),
    description: "Choose when this version becomes available."
)

Reference

Public API

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

APIValues or typeDefaultDescription
titleLocalizedStringKeyRequiredLabels the native date picker.
selectionBinding<Date>RequiredStores the selected native date value.
componentsdate · dateAndTime · timedateChooses the visible date and time parts.
boundsunbounded · closed · from · throughunboundedConstrains selection using native picker bounds.
description / errorMessageLocalizedStringKey?nilShows supporting text or a semantic danger validation message.

Native behavior

Design and accessibility

When to use it

Use for native date input that needs Lumen supporting and validation context. SwiftUI also supports time and combined date-time input.

Accessibility

The native picker retains its label and adjustable behavior. Supporting or validation text remains visible in the same contained group.

Shared component

Available on other platforms

React NativeAndroid / Compose
Apple docsSwiftUI package