CalendarDatePicker
Date picker - Calendar - Single date
Calendar pickers default to showing today’s date when opened and only one month is shown at a time. Calendar pickers allow users to navigate through months and years, however they work best when used for recent or near future dates. If a user needs to input a far distant or future date consider having the calendar default open to a more convenient day.
About the variant
In a single date picker a user has the option to either manually input a date in the text field or select one specific date from the menu calendar. It requires a day, month, and year to be selected.
Compose implementation
This composable uses kotlinx.datetime for date handling and formatting.
(From Date picker documentation)
Parameters
A CalendarDatePickerState that is used to control the state of the date picker.
Text that informs the user about the content they need to type in the field.
The input String text to be shown in the text input.
Whether the calendar menu is currently expanded.
Callback triggered when the input service updates the text. An updated text comes as a parameter of the callback.
Callback triggered when the expanded state of the calendar menu should be changed.
Callback triggered when the calendar menu should be dismissed.
Optional Modifier for this text input.
Optional text that provides hints or examples of what to type.
Optional helper text is pertinent information that assists the user in correctly completing a field. It is often used to explain the correct data format.
The interactive state of the text input.
Software keyboard options that contains configuration such as androidx.compose.ui.text.input.KeyboardType and androidx.compose.ui.text.input.ImeAction.
when the input service emits an IME action, the corresponding callback is called. Note that this IME action may be different from what you specified in KeyboardOptions.imeAction.
Object providing the names of the days of the week to be displayed in the calendar.
The DateTimeFormat used to format the displayed year in the calendar.
The DateTimeFormat used to format the displayed month in the calendar.
The MutableInteractionSource representing the stream of androidx.compose.foundation.interaction.Interactions for this TextField. You can create and pass in your own remembered MutableInteractionSource if you want to observe androidx.compose.foundation.interaction.Interactions and customize the appearance / behavior of this TextField in different androidx.compose.foundation.interaction.Interactions.