DatePicker

fun TileSchemaBuilderScope.DatePicker(id: String = randomId(), events: EventSchemaBuilderScope.() -> Unit = {}, style: StyleSchemaBuilderScope.() -> Unit = {}, searchableTerms: List<String>? = null, visibility: TileSchema.Visibility = visible(), selectedDate: String? = null, enabled: Boolean = true, kind: DatePickerTileSchema.Kind = outlinedDatePicker(), confirmLabel: String, cancelLabel: String, supportingText: String? = null, state: DatePickerTileSchema.State = normalDatePicker())

Renders a read-only text field that opens a Material 3 date picker dialog when tapped. kind picks the field style — filled or outlined. Always shows a calendar leading icon, displays selectedDate (empty when null, as an ISO yyyy-MM-dd string), forwards enabled and supportingText, and switches to Material's error styling when state is error. Typing is impossible — the field is read-only. Opening, closing and date selection are handled entirely on the client: pressing the field opens the dialog, confirming stores the picked date and closes it, cancelling or dismissing just closes it — none of this needs a round trip to the server. The dialog's buttons are labelled with confirmLabel and cancelLabel, and the confirm button stays disabled until a date is picked, so confirming always yields a date. Dispatches onDatePickerOpen when pressed while closed, onDateSelected (carrying the ISO date string) when confirmed, and onDatePickerClose when pressed while open, dismissed, cancelled, or right after a confirm. The current selectedDate can be read from this tile by its id via GetData — it produces no entry at all when no date is selected.

Parameters

id

Unique identifier of the tile. Defaults to a random id.

events

Events owned by this tile, wired to its triggers (onDatePickerOpen, onDatePickerClose, onDateSelected).

style

Layout/appearance modifiers (size, padding, background, etc).

searchableTerms

Terms used by an ancestor's search/filter to decide whether this tile matches. Defaults to none.

visibility

Whether the tile is shown, hidden but occupies space, or removed from layout. Defaults to visible.

selectedDate

ISO (yyyy-MM-dd) date shown in the field. Defaults to none.

enabled

Whether the field is interactive. Defaults to true.

kind

Visual style of the field — filled or outlined. Defaults to outlined.

confirmLabel

Label of the dialog's confirm button.

cancelLabel

Label of the dialog's cancel button.

supportingText

Helper text shown below the field. Defaults to none.

state

Visual state of the field — normal or error. Defaults to normal.