StylishDateRangePicker

fun StylishDateRangePicker(state: DateRangePickerState, modifier: Modifier = Modifier, dateFormatter: DatePickerFormatter = remember { DatePickerDefaults.dateFormatter() }, colors: DatePickerColors = DatePickerDefaults.colors(), title: @Composable () -> Unit? = { DateRangePickerDefaults.DateRangePickerTitle( displayMode = state.displayMode, modifier = Modifier.padding(StylishDateRangePickerTitlePadding), contentColor = colors.titleContentColor, ) }, headline: @Composable () -> Unit? = { DateRangePickerDefaults.DateRangePickerHeadline( selectedStartDateMillis = state.selectedStartDateMillis, selectedEndDateMillis = state.selectedEndDateMillis, displayMode = state.displayMode, dateFormatter = dateFormatter, modifier = Modifier.padding(StylishDateRangePickerHeadlinePadding), contentColor = colors.headlineContentColor, ) }, showModeToggle: Boolean = true, focusRequester: FocusRequester? = remember { FocusRequester() })

A calendar-based date range picker for selecting a start and end date, rendered with the active theme's Material 3 DatePickerColors.

This is the Finish-layer wrapper around the Material 3 DateRangePicker under the ExperimentalMaterial3Api opt-in, so callers can embed the picker without importing the experimental M3 API. The picker is an inline component; embed it in a screen or dialog and create its state with rememberStylishDateRangePickerState. The default title and headline mirror the M3 defaults (selection summary above the calendar, with a mode toggle to switch to direct date input when showModeToggle is true).

Parameters

modifier

Modifier applied to the picker root.

dateFormatter

The DatePickerFormatter used to display dates. Defaults to DatePickerDefaults.dateFormatter.

colors

The DatePickerColors resolving the picker's colors. Defaults to DatePickerDefaults.colors from the active theme.

title

An optional composable displayed above the calendar as the picker title. Defaults to the M3 title showing the current display mode.

headline

An optional composable showing the currently selected range. Defaults to the M3 range headline.

showModeToggle

Whether to show the toggle switching between the calendar and the date range input mode. Defaults to true.

focusRequester

A FocusRequester used to focus the text field when the picker is in input mode. Pass null to skip focusing. Defaults to a remembered FocusRequester.

See also