# ExposedDropdownMenuBoxScope

Artifact: [androidx.compose.material3:material3](https://developer.android.com/jetpack/androidx/releases/compose-material3) [View Source](https://cs.android.com/search?q=file:androidx/compose/material3/ExposedDropdownMenu.kt+class:androidx.compose.material3.ExposedDropdownMenuBoxScope) Common/AllAndroid/JVM
- Cmn

  ```
  sealed class ExposedDropdownMenuBoxScope
  ```

*** ** * ** ***

Scope for `https://developer.android.com/reference/kotlin/androidx/compose/material3/ExposedDropdownMenuBox.composable#ExposedDropdownMenuBox(kotlin.Boolean,kotlin.Function1,androidx.compose.ui.Modifier,kotlin.Function1)`.

## Summary

| ### Protected constructors |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/material3/ExposedDropdownMenuBoxScope#ExposedDropdownMenuBoxScope()()` | Cmn |

| ### Public functions |
|---|---|---|
| `abstract https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier.https://developer.android.com/reference/kotlin/androidx/compose/material3/ExposedDropdownMenuBoxScope#(androidx.compose.ui.Modifier).exposedDropdownSize(kotlin.Boolean)(matchAnchorWidth: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Modifier which should be applied to a menu placed inside the `https://developer.android.com/reference/kotlin/androidx/compose/material3/ExposedDropdownMenuBoxScope`. | Cmn |
| `abstract https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier.https://developer.android.com/reference/kotlin/androidx/compose/material3/ExposedDropdownMenuBoxScope#(androidx.compose.ui.Modifier).menuAnchor(androidx.compose.material3.ExposedDropdownMenuAnchorType,kotlin.Boolean)( type: https://developer.android.com/reference/kotlin/androidx/compose/material3/ExposedDropdownMenuAnchorType, enabled: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` Modifier which should be applied to an element inside the `https://developer.android.com/reference/kotlin/androidx/compose/material3/ExposedDropdownMenuBoxScope`, typically a text field or an icon within the text field. | Cmn |

| ### Extension functions |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/compose/material3/ExposedDropdownMenuBoxScope.https://developer.android.com/reference/kotlin/androidx/compose/material3/ExposedDropdownMenuBoxScope#(androidx.compose.material3.ExposedDropdownMenuBoxScope).ExposedDropdownMenu(kotlin.Boolean,kotlin.Function0,androidx.compose.ui.Modifier,androidx.compose.foundation.ScrollState,kotlin.Boolean,androidx.compose.ui.graphics.Shape,androidx.compose.ui.graphics.Color,androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp,androidx.compose.foundation.BorderStroke,kotlin.Function1)( expanded: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, onDismissRequest: () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html, modifier: https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier, scrollState: https://developer.android.com/reference/kotlin/androidx/compose/foundation/ScrollState, matchAnchorWidth: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, shape: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Shape, containerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, tonalElevation: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp, shadowElevation: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp, border: https://developer.android.com/reference/kotlin/androidx/compose/foundation/BorderStroke?, content: @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/ColumnScope.() -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html )` The composable defining the exposed dropdown menu popup. | Cmn |

## Protected constructors

### ExposedDropdownMenuBoxScope

Cmn

```
protected ExposedDropdownMenuBoxScope()
```

## Public functions

### Modifier.exposedDropdownSize

Cmn Artifact: [androidx.compose.material3:material3](https://developer.android.com/jetpack/androidx/releases/compose-material3) [View Source](https://cs.android.com/search?q=file:androidx/compose/material3/ExposedDropdownMenu.kt+function:exposedDropdownSize)

```
abstract fun Modifier.exposedDropdownSize(matchAnchorWidth: Boolean = true): Modifier
```

Modifier which should be applied to a menu placed inside the `https://developer.android.com/reference/kotlin/androidx/compose/material3/ExposedDropdownMenuBoxScope`. It will set constraints on the width and height of the menu so it will not overlap the text field or software keyboard.

`https://developer.android.com/reference/kotlin/androidx/compose/material3/ExposedDropdownMenu.composable#(androidx.compose.material3.ExposedDropdownMenuBoxScope).ExposedDropdownMenu(kotlin.Boolean,kotlin.Function0,androidx.compose.ui.Modifier,androidx.compose.foundation.ScrollState,kotlin.Boolean,androidx.compose.ui.graphics.Shape,androidx.compose.ui.graphics.Color,androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp,androidx.compose.foundation.BorderStroke,kotlin.Function1)` applies this modifier automatically, so this is only needed when using custom menu components.

| Parameters |
|---|---|
| `matchAnchorWidth: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = true` | whether the menu's width should be forcefully constrained to match the width of the text field to which it's attached. |

### Modifier.menuAnchor

Cmn Artifact: [androidx.compose.material3:material3](https://developer.android.com/jetpack/androidx/releases/compose-material3) [View Source](https://cs.android.com/search?q=file:androidx/compose/material3/ExposedDropdownMenu.kt+function:menuAnchor)

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

Modifier which should be applied to an element inside the `https://developer.android.com/reference/kotlin/androidx/compose/material3/ExposedDropdownMenuBoxScope`, typically a text field or an icon within the text field. It's responsible for requesting focus, and if `https://developer.android.com/reference/kotlin/androidx/compose/material3/ExposedDropdownMenuBoxScope#(androidx.compose.ui.Modifier).menuAnchor(androidx.compose.material3.ExposedDropdownMenuAnchorType,kotlin.Boolean)`, expanding/collapsing the menu on click and applying semantics.

| Parameters |
|---|---|
| `type: https://developer.android.com/reference/kotlin/androidx/compose/material3/ExposedDropdownMenuAnchorType` | the type of element that is anchoring the menu. See `https://developer.android.com/reference/kotlin/androidx/compose/material3/ExposedDropdownMenuAnchorType`. |
| `enabled: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = true` | whether controlling the menu via this anchor is enabled. When `false`, the component will not expand or collapse the menu in response to user input, and menu semantics will be invisible to accessibility services. Note that this value only controls interactions with the menu. It does not affect the enabled state of other kinds of interactions, such as `https://developer.android.com/reference/kotlin/androidx/compose/material3/TextField.composable#TextField(androidx.compose.foundation.text.input.TextFieldState,androidx.compose.ui.Modifier,kotlin.Boolean,kotlin.Boolean,androidx.compose.ui.text.TextStyle,androidx.compose.material3.TextFieldLabelPosition,kotlin.Function1,kotlin.Function0,kotlin.Function0,kotlin.Function0,kotlin.Function0,kotlin.Function0,kotlin.Function0,kotlin.Boolean,androidx.compose.foundation.text.input.InputTransformation,androidx.compose.foundation.text.input.OutputTransformation,androidx.compose.foundation.text.KeyboardOptions,androidx.compose.foundation.text.input.KeyboardActionHandler,androidx.compose.foundation.text.input.TextFieldLineLimits,kotlin.Function2,androidx.compose.foundation.ScrollState,androidx.compose.ui.graphics.Shape,androidx.compose.material3.TextFieldColors,androidx.compose.foundation.layout.PaddingValues,androidx.compose.foundation.interaction.MutableInteractionSource)`'s `enabled` parameter. |

## Extension functions

### ExposedDropdownMenuBoxScope.ExposedDropdownMenu

Cmn Artifact: [androidx.compose.material3:material3](https://developer.android.com/jetpack/androidx/releases/compose-material3) [View Source](https://cs.android.com/search?q=file:androidx/compose/material3/ExposedDropdownMenu.kt+function:ExposedDropdownMenu)

```
@Composable
fun ExposedDropdownMenuBoxScope.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
): Unit
```

The composable defining the exposed dropdown menu popup. It should be used inside the content of `https://developer.android.com/reference/kotlin/androidx/compose/material3/ExposedDropdownMenuBox.composable#ExposedDropdownMenuBox(kotlin.Boolean,kotlin.Function1,androidx.compose.ui.Modifier,kotlin.Function1)`.

| Parameters |
|---|---|
| `expanded: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | whether the menu is expanded |
| `onDismissRequest: () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | called when the user requests to dismiss the menu, such as by tapping outside the menu's bounds |
| `modifier: https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier = Modifier` | the `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier` to be applied to this menu |
| `scrollState: https://developer.android.com/reference/kotlin/androidx/compose/foundation/ScrollState = rememberScrollState()` | a `https://developer.android.com/reference/kotlin/androidx/compose/foundation/ScrollState` used by the menu's content for items vertical scrolling |
| `matchAnchorWidth: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = true` | whether the menu's width should be forcefully constrained to match the width of the text field to which it's attached. |
| `shape: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Shape = MenuDefaults.shape` | the shape of the menu |
| `containerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = MenuDefaults.containerColor` | the container color of the menu |
| `tonalElevation: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp = MenuDefaults.TonalElevation` | when `https://developer.android.com/reference/kotlin/androidx/compose/material3/package-summary#(androidx.compose.material3.ExposedDropdownMenuBoxScope).ExposedDropdownMenu(kotlin.Boolean,kotlin.Function0,androidx.compose.ui.Modifier,androidx.compose.foundation.ScrollState,kotlin.Boolean,androidx.compose.ui.graphics.Shape,androidx.compose.ui.graphics.Color,androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp,androidx.compose.foundation.BorderStroke,kotlin.Function1)` is `https://developer.android.com/reference/kotlin/androidx/compose/material3/ColorScheme#surface()`, a translucent primary color overlay is applied on top of the container. A higher tonal elevation value will result in a darker color in light theme and lighter color in dark theme. See also: `https://developer.android.com/reference/kotlin/androidx/compose/material3/Surface.composable#Surface(androidx.compose.ui.Modifier,androidx.compose.ui.graphics.Shape,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp,androidx.compose.foundation.BorderStroke,kotlin.Function0)`. |
| `shadowElevation: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp = MenuDefaults.ShadowElevation` | the elevation for the shadow below the menu |
| `border: https://developer.android.com/reference/kotlin/androidx/compose/foundation/BorderStroke? = null` | the border to draw around the container of the menu. Pass `null` for no border. |
| `content: @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/ColumnScope.() -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | the content of the menu |