androidx.compose.material3

TimeInput

Composable function

One of the types and parts. It works like TimePicker. Only the parameters that differ are described here.

Two text fields for hours and minutes, instead of a clock.

Type the time instead
Type the time instead
val state = rememberTimePickerState(initialHour = 18, initialMinute = 45, is24Hour = true)
TimeInput(state = state)

Basic

Uses the default shapes.

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

Same as in TimePicker: state, modifier, colors.

ExpressiveSince 1.12

Takes shapes for the time boxes and AM/PM buttons.

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

Defaults that differ from TimePicker:

Same as in TimePicker: state, shapes, modifier, colors.

Types and parts

See also