Skip to main content
196

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Android docs
FormsAndroid

Time field

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

Public APILumenTimeFieldAndroid / Compose

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 Android phone emulator Lumen playground
Captured exampleAndroid phone emulator
kotlin
LumenTimeField(
    label = "Meeting time",
    value = meetingTime,
    onValueChange = { meetingTime = it },
    minTime = LumenTimeSelection(8, 30),
    maxTime = LumenTimeSelection(17, 0)
)

Reference

Public API

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

APIValues or typeDefaultDescription
labelStringRequiredNames the field and selection dialog.
value / onValueChangeLumenTimeSelection? / (LumenTimeSelection) -> UnitRequiredControls the confirmed local hour and minute.
modifierModifierModifierApplies layout and semantics to the field group.
minTime / maxTimeLumenTimeSelection?nullInclusive same-day bounds; minimum must not exceed maximum.
is24HourBoolean?nullFollows the system preference unless explicitly set.
description / errorMessageString?nullShows supporting context or host validation.
placeholderStringChoose a timeDisplays the empty state.
confirmLabel / dismissLabelStringConfirm / CancelNames the native confirmation and cancellation actions.
inputLabel / dialLabelStringUse keyboard / Use clockNames the input mode switch.
rangeErrorLabelStringChoose a time within the allowed rangeExplains invalid draft selection.
enabled / readOnlyBooleantrue / falseControls editing and dismisses open selection when editing becomes unavailable.

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 NativeApple / SwiftUI
Android docsCompose module