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

← Back to Material Compose

DropdownMenuItem

Component
in
Material
. Since 0.1.0-dev15

Overview

Code Examples

<a href="https://material.io/components/menus#dropdown-menu" class="external" target="_blank">Material Design dropdown menu</a> item.

Overloads

@Composable
fun DropdownMenuItem(
    onClick: () -> Unit,
    modifier: Modifier = Modifier,
    enabled: Boolean = true,
    contentPadding: PaddingValues = MenuDefaults.DropdownMenuItemContentPadding,
    interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
    content: @Composable RowScope.() -> Unit
)

Parameters

NameDescription
onClickCalled when the menu item was clicked
modifierThe modifier to be applied to the menu item
enabledControls the enabled state of the menu item - when false, the menu item will not be clickable and onClick will not be invoked
contentPaddingthe padding applied to the content of this menu item
interactionSourcethe MutableInteractionSource representing the stream of Interactions for this DropdownMenuItem. You can create and pass in your own remembered MutableInteractionSource if you want to observe Interactions and customize the appearance / behavior of this DropdownMenuItem in different Interactions