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

← Back to Compose UI

DropdownPopup

Component
in
Compose UI
. Since 0.1.0-dev15

Overview

Code Examples

Opens a popup with the given content.

The dropdown popup is positioned below its parent, using the dropDownAlignment and offset. The dropdown popup is visible as long as it is part of the composition hierarchy.

Overloads

@Composable
fun DropdownPopup(
    dropDownAlignment: DropDownAlignment = DropDownAlignment.Start,
    offset: IntOffset = IntOffset(0, 0),
    isFocusable: Boolean = false,
    onDismissRequest: (() -> Unit)? = null,
    children: @Composable () -> Unit
)

Parameters

NameDescription
dropDownAlignmentThe start or end alignment below the parent.
offsetAn offset from the original aligned position of the popup.
isFocusableIndicates if the popup can grab the focus.
onDismissRequestExecutes when the popup tries to dismiss itself. This happens when the popup is focusable and the user clicks outside.
childrenThe content to be displayed inside the popup