State of Compose 2023 results are in! Click here to learn more

← Back to Material Compose

ExposedDropdownMenuBox

Component
in
Material
. Since 1.1.0

Overview

Code Examples

Material Design Exposed Dropdown Menu(https://material.io/components/menus#exposed-dropdown-menu).

Box for Exposed Dropdown Menu. Expected to contain TextField and ExposedDropdownMenuBoxScope.ExposedDropdownMenu as a content.

An example of read-only Exposed Dropdown Menu:

Overloads

ExposedDropdownMenuBox

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

Parameters

NameDescription
expandedWhether Dropdown Menu should be expanded or not.
onExpandedChangeExecutes when the user clicks on the ExposedDropdownMenuBox.
modifierThe modifier to apply to this layout
contentThe content to be displayed inside ExposedDropdownMenuBox