ExposedDropdownMenuBox

@Composable
expect fun ExposedDropdownMenuBox(expanded: Boolean, onExpandedChange: (Boolean) -> Unit, modifier: Modifier = Modifier, content: @Composable ExposedDropdownMenuBoxScope.() -> Unit)

Material Design Exposed Dropdown Menu.

Menus display a list of choices on a temporary surface. They appear when users interact with a button, action, or other control.

Exposed dropdown menus, sometimes also called "spinners" or "combo boxes", display the currently selected item in a text field to which the menu is anchored. In some cases, it can accept and display user input (whether or not it’s listed as a menu choice), in which case it may be used to implement autocomplete.

Exposed dropdown menu image

The ExposedDropdownMenuBox is expected to contain a TextField (or OutlinedTextField) and ExposedDropdownMenu as content. The menuAnchor modifier should be passed to the text field.

An example of a read-only Exposed Dropdown Menu:

Parameters

expanded

whether the menu is expanded or not

onExpandedChange

called when the exposed dropdown menu is clicked and the expansion state changes.

modifier

the Modifier to be applied to this ExposedDropdownMenuBox

content

the content of this ExposedDropdownMenuBox, typically a TextField and an ExposedDropdownMenu.

Samples

androidx.compose.material3.samples.ExposedDropdownMenuSampleandroidx.compose.material3.samples.EditableExposedDropdownMenuSample