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

← Back to Material 3 Compose

TimePicker

Component
in
Material 3
. Since 1.1.0

Overview

Code Examples

<a href="https://m3.material.io/components/time-pickers/overview" class="external" target="_blank">Material Design time picker</a>.

Time pickers help users select and set a specific time.

Shows a picker that allows the user to select time. Subscribe to updates through TimePickerState

!Time picker image(https://developer.android.com/images/reference/androidx/compose/material3/time-picker.png)

Overloads

TimePicker

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

Parameters

NameDescription
statestate for this time input, allows to subscribe to changes to TimePickerState.hour and TimePickerState.minute, and set the initial time for this input.
modifierthe Modifier to be applied to this time input
colorscolors TimePickerColors that will be used to resolve the colors used for this time picker in different states. See TimePickerDefaults.colors.
layoutType,the different TimePickerLayoutType supported by this time picker, it will change the position and sizing of different components of the timepicker