State of Compose 2023 results are in! Click here to learn more

← Back to Material 3 Compose

TimeInput

Component
in
Material 3
. Since 1.1.0

Overview

Code Examples

Time pickers help users select and set a specific time.

Shows a time input that allows the user to enter the time via two text fields, one for minutes and one for hours Subscribe to updates through TimePickerState

Overloads

TimeInput

@Composable
@ExperimentalMaterial3Api
fun TimeInput(
    state: TimePickerState,
    modifier: Modifier = Modifier,
    colors: TimePickerColors = TimePickerDefaults.colors(),
)

Parameters

NameDescription
statestate for this timepicker, allows to subscribe to changes to TimePickerState.hour and TimePickerState.minute, and set the initial time for this picker.
modifierthe Modifier to be applied to this time input
colorscolors TimePickerColors that will be used to resolve the colors used for this time input in different states. See TimePickerDefaults.colors