DurationPicker

fun DurationPicker(modifier: Modifier = Modifier, pickerModifier: Modifier = Modifier, state: DurationPickerState = rememberDurationPickerState(), onSelectedDurationChange: (Duration) -> Unit = {}, enabled: Boolean = true, items: DurationPickerItems = PickerDefaults.durationPickerItems(), format: DurationPickerFormat = PickerDefaults.durationPickerFormat(), style: PickerStyle = PickerDefaults.style(), selectionIndicator: PickerSelectionIndicator = PickerDefaults.selectionIndicator(style), layout: DurationPickerLayout = PickerDefaults.durationPickerLayout(), spacingBetweenPickers: Dp = PickerDefaults.SpacingBetweenPickers, semantics: DurationPickerSemantics = PickerDefaults.durationPickerSemantics())

Selects a finite, non-negative, whole-minute Duration with elapsed-hour and minute columns.

Each user-settled column change is repaired against the combined scalar constraints before one logical value is committed to state. Programmatic DurationPickerState.selectDuration calls update state without invoking onSelectedDurationChange and replace any in-flight child interaction generation.

Parameters

modifier

Modifier applied to the whole component.

pickerModifier

Modifier applied to each child picker column.

state

Saveable logical duration state.

onSelectedDurationChange

Called once after a user interaction settles, dependent values are repaired, and the final selectable duration has been committed to state.

enabled

Whether user scroll, click, and semantics actions are enabled.

items

Selectable elapsed-hour/minute sources and inclusive scalar constraints.

format

Visible text and optional value content descriptions for both columns.

style

Visual and layout styling for each child column.

selectionIndicator

Shared selection band drawn across the whole component.

layout

Column weights and visual order.

spacingBetweenPickers

Horizontal spacing between child columns.

semantics

Accessibility labels and action labels for both columns.

Throws

if item sources are empty, duplicated, outside supported ranges, have no scalar combination allowed by constraints, or do not contain the current selection.