DatePicker

Composable Component

Full screen DatePicker with day, month, year.

Android
@RequiresApi(Build.VERSION_CODES.O)
@Composable
public fun DatePicker(
    initialDate: LocalDate,
    onDatePicked: (LocalDate) -> Unit,
    modifier: Modifier = Modifier,
    minValidDate: LocalDate? = null,
    maxValidDate: LocalDate? = null,
    datePickerType: DatePickerType = DatePickerDefaults.datePickerType,
    colors: DatePickerColors = DatePickerDefaults.datePickerColors(),
)

Parameters

initialDateThe initial value to be displayed in the DatePicker.
onDatePickedThe callback that is called when the user confirms the date selection. It provides the selected date as LocalDate
modifierModifier to be applied to the Box containing the UI elements.
minValidDateOptional minimum date that can be selected in the DatePicker (inclusive).
maxValidDateOptional maximum date that can be selected in the DatePicker (inclusive).
datePickerTypeThe different DatePickerType supported by this DatePicker.
colorsDatePickerColors to be applied to the DatePicker.