DatePicker

fun DatePicker(value: DateValue, onValueChange: (DateValue) -> Unit, modifier: Modifier = Modifier, enabled: Boolean = true, yearRange: IntRange = DatePickerDefaults.YearRange, yearLabel: (Int) -> String = DatePickerDefaults.YearLabel, monthLabel: (Int) -> String = DatePickerDefaults.MonthLabel, dayLabel: (Int) -> String = DatePickerDefaults.DayLabel, yearColumnWidth: Dp = DatePickerDefaults.YearColumnWidth, monthColumnWidth: Dp = DatePickerDefaults.MonthColumnWidth, dayColumnWidth: Dp = DatePickerDefaults.DayColumnWidth, colors: NumberPickerColors = NumberPickerDefaults.colors(), textStyle: TextStyle = COUITheme.textStyles.title3, itemHeight: Dp = NumberPickerDefaults.ItemHeight, insideMargin: PaddingValues = DatePickerDefaults.InsideMargin)

A DatePicker component with COUI style.

Three scroll wheels (year / month / day) arranged like the COUI date picker: the columns are centered as a group, the day range follows the selected year and month (leap years included), and the day is clamped when a shorter month is selected. All columns wrap around, matching COUIDatePicker.

Parameters

value

The currently selected date. Out-of-range fields are coerced.

onValueChange

The callback invoked when the selected date changes.

modifier

The modifier to be applied to the DatePicker.

enabled

Whether the DatePicker is enabled for user interaction.

yearRange

The selectable year range.

yearLabel

Converts a year to its display string.

monthLabel

Converts a month (1..12) to its display string.

dayLabel

Converts a day of month to its display string.

yearColumnWidth

The width of the year column.

monthColumnWidth

The width of the month column.

dayColumnWidth

The width of the day column.

colors

The NumberPickerColors for the wheels.

textStyle

The TextStyle for the wheel items.

itemHeight

The height of each wheel item.

insideMargin

The padding around the wheel columns.