DropdownList

fun TileSchemaBuilderScope.DropdownList(id: String = randomId(), events: EventSchemaBuilderScope.() -> Unit = {}, style: StyleSchemaBuilderScope.() -> Unit = {}, searchableTerms: List<String>? = null, visibility: TileSchema.Visibility = visible(), options: List<DropdownListTileSchema.SelectOption>, selectedOptionId: String, enabled: Boolean = true, kind: DropdownListTileSchema.Kind = outlinedDropdownList(), supportingText: String? = null, state: DropdownListTileSchema.State = normalDropdownList())

Renders a Material 3 exposed dropdown menu: a read-only anchor field showing the label of the currently selected option, plus a dropdown listing every entry in options. kind picks the anchor style — filled or outlined. enabled and supportingText are forwarded, and state set to error switches the field into Material's error styling. The anchor displays the label of the option whose id equals selectedOptionIdselectedOptionId must match one of options' ids, or building this tile throws. Opening, closing and item selection are handled entirely on the client: tapping the anchor toggles the menu, tapping an item stores the new selection and closes the menu, dismissing (tapping outside) just closes it — none of this needs a round trip to the server. Dispatches onDropdownListOpen when the anchor is tapped while closed; onDropdownListItemSelected (carrying the picked option's id) when an item is picked; and onDropdownListClose whenever the menu closes — anchor tapped while open, dismissed by tapping outside, or right after an item is picked. The current selectedOptionId can be read from this tile by its id via GetData.

Parameters

id

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

events

Events owned by this tile, wired to its triggers (onDropdownListOpen, onDropdownListClose, onDropdownListItemSelected).

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.

options

Options listed in the dropdown menu, built with selectOption.

selectedOptionId

Id of the currently selected option. Must match one of options' ids.

enabled

Whether the field is interactive. Defaults to true.

kind

Visual style of the anchor field — filledDropdownList or outlinedDropdownList. Defaults to outlined.

supportingText

Helper text shown below the field. Defaults to none.

state

Visual state of the field — normalDropdownList or errorDropdownList. Defaults to normal.