TimePicker

Composable Component

A full screen TimePicker with configurable columns that allows users to select a time.

Android
@RequiresApi(Build.VERSION_CODES.O)
@Composable
public fun TimePicker(
    initialTime: LocalTime,
    onTimePicked: (LocalTime) -> Unit,
    modifier: Modifier = Modifier,
    timePickerType: TimePickerType = TimePickerDefaults.timePickerType,
    colors: TimePickerColors = TimePickerDefaults.timePickerColors(),
)

Parameters

initialTimeThe initial time to be displayed in the TimePicker.
onTimePickedThe callback that is called when the user confirms the time selection. It provides the selected time as LocalTime.
modifierModifier to be applied to the Box containing the UI elements.
timePickerTypeThe different TimePickerType supported by this time picker. It indicates whether to show seconds or AM/PM selector as well as hours and minutes.
colorsTimePickerColors be applied to the TimePicker.