CamoDatePicker
A date field: the text-field frame showing value in DatePickerTheme.displayFormat (or the locale's
medium date), opening a calendar (or wheels, per DatePickerTheme.form) in a popup on wide windows and a
bottom sheet otherwise (presentation). Single dates confirm with Cancel/OK unless
DatePickerTheme.confirmButton is off, when a tap picks and closes.
On desktop and web (DatePickerTheme.allowTyping = Auto) the field also takes typing in the locale's short
date pattern; a complete, valid date in range calls onValueChange, anything else shows "Enter a valid date"
(DatePickerStrings) and leaves value alone.
API: CamoDateField
- Kotlin
- Dart
public fun CamoDateField(
value: LocalDate?,
onValueChange: (LocalDate) -> Unit,
modifier: Modifier = Modifier,
label: String? = null,
placeholder: String? = null,
supportingText: String? = null,
error: String? = null,
minDate: LocalDate? = null,
maxDate: LocalDate? = null,
isSelectable: ((LocalDate) -> Boolean)? = null,
presentation: PickerPresentation = PickerPresentation.Auto,
enabled: Boolean = true,
onFocusChanged: ((Boolean) -> Unit)? = null,
)
| Name | Type | Default |
|---|---|---|
value | LocalDate? | |
onValueChange | (LocalDate) -> Unit | required |
modifier | Modifier | Modifier |
label | String? | null |
placeholder | String? | null |
supportingText | String? | null |
error | String? | null |
minDate | LocalDate? | null |
maxDate | LocalDate? | null |
isSelectable | ((LocalDate) -> Boolean)? | null |
presentation | PickerPresentation | PickerPresentation.Auto |
enabled | Boolean | true |
onFocusChanged | ((Boolean) -> Unit)? | null |
API: CamoDateRangeField
- Kotlin
- Dart
public fun CamoDateRangeField(
value: CamoDateRange?,
onValueChange: (CamoDateRange) -> Unit,
modifier: Modifier = Modifier,
label: String? = null,
placeholder: String? = null,
supportingText: String? = null,
error: String? = null,
minDate: LocalDate? = null,
maxDate: LocalDate? = null,
isSelectable: ((LocalDate) -> Boolean)? = null,
maxLength: Int? = null,
presentation: PickerPresentation = PickerPresentation.Auto,
enabled: Boolean = true,
onFocusChanged: ((Boolean) -> Unit)? = null,
)
| Name | Type | Default |
|---|---|---|
value | CamoDateRange? | |
onValueChange | (CamoDateRange) -> Unit | required |
modifier | Modifier | Modifier |
label | String? | null |
placeholder | String? | null |
supportingText | String? | null |
error | String? | null |
minDate | LocalDate? | null |
maxDate | LocalDate? | null |
isSelectable | ((LocalDate) -> Boolean)? | null |
maxLength | Int? | null |
presentation | PickerPresentation | PickerPresentation.Auto |
enabled | Boolean | true |
onFocusChanged | ((Boolean) -> Unit)? | null |
Design notes
Why CamoDatePicker works this way, its states and its edge cases: contributor docs.