androidx.compose.material3

ExposedDropdownMenuBoxScopeExperimental

Sealed class

No hand-written docs yet.

Scope for ExposedDropdownMenuBox.

sealed class ExposedDropdownMenuBoxScope

Used by

Parameters that take a ExposedDropdownMenuBoxScope.

Functions

fun Modifier.menuAnchor(
    type: ExposedDropdownMenuAnchorType,
    enabled: Boolean = true,
): Modifier

Modifier which should be applied to an element inside the ExposedDropdownMenuBoxScope, typically a text field or an icon within the text field. It's responsible for requesting focus, and if enabled, expanding/collapsing the menu on click and applying semantics.

exposedDropdownSize

fun Modifier.exposedDropdownSize(
    matchAnchorWidth: Boolean = true,
): Modifier

Modifier which should be applied to a menu placed inside the ExposedDropdownMenuBoxScope. It will set constraints on the width and height of the menu so it will not overlap the text field or software keyboard.

ExposedDropdownMenu

@Composable
fun ExposedDropdownMenu(
    expanded: Boolean,
    onDismissRequest: () -> Unit,
    modifier: Modifier = Modifier,
    scrollState: ScrollState = rememberScrollState(),
    matchAnchorWidth: Boolean = true,
    shape: Shape = MenuDefaults.shape,
    containerColor: Color = MenuDefaults.containerColor,
    tonalElevation: Dp = MenuDefaults.TonalElevation,
    shadowElevation: Dp = MenuDefaults.ShadowElevation,
    border: BorderStroke? = null,
    content: @Composable ColumnScope.() -> Unit,
)

Popup which contains content for Exposed Dropdown Menu. Should be used inside the content of ExposedDropdownMenuBox.

Library docs

Scope for ExposedDropdownMenuBox.