🌈 Create new beautiful Compose Gradients with our new wesite ->
Compose Component

DropdownMenu

DropdownMenu social preview
Source set: Android
@Deprecated(
    level = DeprecationLevel.HIDDEN,
    replaceWith =
        ReplaceWith(
            expression =
                "DropdownMenu(expanded,onDismissRequest, modifier, offset, " +
                    "rememberScrollState(), properties, content)",
            "androidx.compose.foundation.rememberScrollState",
        ),
    message = "Replaced by a DropdownMenu function with a ScrollState parameter",
)
@Composable
public fun DropdownMenu(
    expanded: Boolean,
    onDismissRequest: () -> Unit,
    modifier: Modifier = Modifier,
    offset: DpOffset = DpOffset(0.dp, 0.dp),
    properties: PopupProperties = PopupProperties(focusable = true),
    content: @Composable ColumnScope.() -> Unit,
): Unit
Source set: Android
@Composable
public fun DropdownMenu(
    expanded: Boolean,
    onDismissRequest: () -> Unit,
    modifier: Modifier,
    offset: DpOffset,
    scrollState: ScrollState,
    properties: PopupProperties,
    content: @Composable ColumnScope.() -> Unit,
)
Source set: Common
@Composable
public fun DropdownMenu(
    expanded: Boolean,
    onDismissRequest: () -> Unit,
    modifier: Modifier = Modifier,
    offset: DpOffset = DpOffset(0.dp, 0.dp),
    scrollState: ScrollState = rememberScrollState(),
    properties: PopupProperties = DefaultMenuProperties,
    content: @Composable ColumnScope.() -> Unit,
)

Parameters

expanded whether the menu is expanded or not
onDismissRequest called when the user requests to dismiss the menu, such as by tapping outside the menu's bounds
modifier Modifier to be applied to the menu's content
offset DpOffset from the original position of the menu. The offset respects the LayoutDirection, so the offset's x position will be added in LTR and subtracted in RTL.
scrollState a ScrollState to used by the menu's content for items vertical scrolling
properties PopupProperties for further customization of this popup's behavior
content the content of this dropdown menu, typically a DropdownMenuItem