# TimePickerState

Artifact: [androidx.compose.material3:material3](https://developer.android.com/jetpack/androidx/releases/compose-material3) [View Source](https://cs.android.com/search?q=file:androidx/compose/material3/TimePicker.kt+class:androidx.compose.material3.TimePickerState) Common/AllAndroid/JVM
- Cmn

  ```
  interface TimePickerState
  ```

*** ** * ** ***

A state object that can be hoisted to observe the time picker state. It holds the current values and allows for directly setting those values.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/material3/rememberTimePickerState.composable#rememberTimePickerState(kotlin.Int,kotlin.Int,kotlin.Boolean)` | to construct the default implementation. |

## Summary

| ### Public properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/TimePickerState#hour()` The currently selected hour (0-23). | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/TimePickerState#hourInput()` The input for the hour. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/TimePickerState#is24hour()` Indicates whether the time picker uses 24-hour format (`true`) or 12-hour format with AM/PM (`false`). | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/TimePickerState#minute()` The currently selected minute (0-59). | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/TimePickerState#minuteInput()` The input for the minute. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/material3/TimePickerSelectionMode` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/TimePickerState#selection()` Specifies whether the hour or minute component is being actively selected by the user. | Cmn |

| ### Extension properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/TimePickerState.https://developer.android.com/reference/kotlin/androidx/compose/material3/TimePickerState#(androidx.compose.material3.TimePickerState).isHourInputValid()` `true` if the current `hourInput` represents a valid hour (0-23 for 24h, 0-11 for 12h AM, 12-23 for 12h PM). | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/TimePickerState.https://developer.android.com/reference/kotlin/androidx/compose/material3/TimePickerState#(androidx.compose.material3.TimePickerState).isInputValid()` `true` if the time input values are valid. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/TimePickerState.https://developer.android.com/reference/kotlin/androidx/compose/material3/TimePickerState#(androidx.compose.material3.TimePickerState).isMinuteInputValid()` `true` if the current `minuteInput` represents a valid minute (0-59). | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/TimePickerState.https://developer.android.com/reference/kotlin/androidx/compose/material3/TimePickerState#(androidx.compose.material3.TimePickerState).isPm()` Indicates whether the selected time falls within the period from 12 PM inclusive to 12 AM non inclusive. | Cmn |

## Public properties

### hour

Cmn

```
var hour: Int
```

The currently selected hour (0-23).

This value is always valid. `https://developer.android.com/reference/kotlin/androidx/compose/material3/TimePickerState#hourInput()` was added later to allow tracking invalid input (e.g. mid-typing in `https://developer.android.com/reference/kotlin/androidx/compose/material3/TimeInput.composable#TimeInput(androidx.compose.material3.TimePickerState,androidx.compose.ui.Modifier,androidx.compose.material3.TimeInputColors)`) without changing the behavior of this property, which always guarantees a valid value.

### hourInput

Cmn

```
open var hourInput: Int
```

The input for the hour.

UI should be bound to this value. This value can be invalid (e.g. during typing). If valid, it updates `https://developer.android.com/reference/kotlin/androidx/compose/material3/TimePickerState#hour()`. This property was added to allow tracking mid-typing state in `https://developer.android.com/reference/kotlin/androidx/compose/material3/TimeInput.composable#TimeInput(androidx.compose.material3.TimePickerState,androidx.compose.ui.Modifier,androidx.compose.material3.TimeInputColors)` without polluting `https://developer.android.com/reference/kotlin/androidx/compose/material3/TimePickerState#hour()` with invalid values.

### is24hour

Cmn

```
var is24hour: Boolean
```

Indicates whether the time picker uses 24-hour format (`true`) or 12-hour format with AM/PM (`false`).

### minute

Cmn

```
var minute: Int
```

The currently selected minute (0-59).

This value is always valid. `https://developer.android.com/reference/kotlin/androidx/compose/material3/TimePickerState#minuteInput()` was added later to allow tracking invalid input (e.g. mid-typing in `https://developer.android.com/reference/kotlin/androidx/compose/material3/TimeInput.composable#TimeInput(androidx.compose.material3.TimePickerState,androidx.compose.ui.Modifier,androidx.compose.material3.TimeInputColors)`) without changing the behavior of this property, which always guarantees a valid value.

### minuteInput

Cmn

```
open var minuteInput: Int
```

The input for the minute.

UI should be bound to this value. This value can be invalid (e.g. during typing). If valid, it updates `https://developer.android.com/reference/kotlin/androidx/compose/material3/TimePickerState#minute()`. This property was added to allow tracking mid-typing state in `https://developer.android.com/reference/kotlin/androidx/compose/material3/TimeInput.composable#TimeInput(androidx.compose.material3.TimePickerState,androidx.compose.ui.Modifier,androidx.compose.material3.TimeInputColors)` without polluting `https://developer.android.com/reference/kotlin/androidx/compose/material3/TimePickerState#minute()` with invalid values.

### selection

Cmn

```
var selection: TimePickerSelectionMode
```

Specifies whether the hour or minute component is being actively selected by the user.

## Extension properties

### TimePickerState.isHourInputValid

Cmn Artifact: [androidx.compose.material3:material3](https://developer.android.com/jetpack/androidx/releases/compose-material3) [View Source](https://cs.android.com/search?q=file:androidx/compose/material3/TimePicker.kt+symbol:isHourInputValid)

```
val TimePickerState.isHourInputValid: Boolean
```

`true` if the current `hourInput` represents a valid hour (0-23 for 24h, 0-11 for 12h AM, 12-23 for 12h PM).

### TimePickerState.isInputValid

Cmn Artifact: [androidx.compose.material3:material3](https://developer.android.com/jetpack/androidx/releases/compose-material3) [View Source](https://cs.android.com/search?q=file:androidx/compose/material3/TimePicker.kt+symbol:isInputValid)

```
val TimePickerState.isInputValid: Boolean
```

`true` if the time input values are valid.

### TimePickerState.isMinuteInputValid

Cmn Artifact: [androidx.compose.material3:material3](https://developer.android.com/jetpack/androidx/releases/compose-material3) [View Source](https://cs.android.com/search?q=file:androidx/compose/material3/TimePicker.kt+symbol:isMinuteInputValid)

```
val TimePickerState.isMinuteInputValid: Boolean
```

`true` if the current `minuteInput` represents a valid minute (0-59).

### TimePickerState.isPm

Cmn Artifact: [androidx.compose.material3:material3](https://developer.android.com/jetpack/androidx/releases/compose-material3) [View Source](https://cs.android.com/search?q=file:androidx/compose/material3/TimePicker.kt+symbol:isPm)

```
val TimePickerState.isPm: Boolean
```

Indicates whether the selected time falls within the period from 12 PM inclusive to 12 AM non inclusive.