DateRangePicker

fun DateRangePicker(modifier: Modifier = Modifier, pickerModifier: Modifier = Modifier, state: DateRangePickerState = rememberDateRangePickerState(), onSelectedDateRangeChange: (DateRange) -> Unit = {}, enabled: Boolean = true, items: DatePickerItems = PickerDefaults.datePickerItems(), format: DatePickerFormat = PickerDefaults.datePickerFormat(), style: PickerStyle = PickerDefaults.style(), selectionIndicator: PickerSelectionIndicator = PickerDefaults.selectionIndicator(style), layout: DatePickerLayout = PickerDefaults.datePickerLayout(), spacingBetweenPickers: Dp = PickerDefaults.SpacingBetweenPickers, spacingBetweenDatePickers: Dp = 16.dp, startLabel: @Composable () -> Unit? = { DateRangePickerLabel("Start date") }, endLabel: @Composable () -> Unit? = { DateRangePickerLabel("End date") }, semantics: DateRangePickerSemantics = PickerDefaults.dateRangePickerSemantics())

A date range picker composed from two ordered DatePicker components.

Parameters

modifier

The modifier to be applied to the component.

pickerModifier

The modifier to be applied to each child picker column.

state

The state object to control the selected date range.

onSelectedDateRangeChange

Called after user interaction changes the selected range. Programmatic DateRangePickerState.selectDateRange, DateRangePickerState.selectStartDate, and DateRangePickerState.selectEndDate calls update state directly and do not invoke this callback. When app code changes the picker from a button, preset, or external value, update any app-owned state in the same handler.

enabled

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

items

Selectable year/month/day item lists plus optional inclusive date bounds.

format

Visible item text and optional accessibility value descriptions shared by both child pickers.

style

Visual and layout styling for each picker column. Per-column divider settings do not apply here; use selectionIndicator for the shared selection band instead.

selectionIndicator

The single selection band drawn across each child DatePicker. Defaults to a band derived from style.

layout

Column layout weights and visual order for each child DatePicker.

spacingBetweenPickers

Horizontal spacing between columns inside each child DatePicker.

spacingBetweenDatePickers

Vertical spacing between start and end pickers.

startLabel

Optional visible label displayed above the start picker.

endLabel

Optional visible label displayed above the end picker.

semantics

Accessibility labels for the start and end pickers.