# ExposedDropdownMenuBoxScope

# ExposedDropdownMenuBoxScope

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

  ```
  @ExperimentalMaterialApi
  abstract class ExposedDropdownMenuBoxScope
  ```

*** ** * ** ***

Scope for[ExposedDropdownMenuBox](https://developer.android.com/reference/kotlin/androidx/compose/material/package-summary#ExposedDropdownMenuBox(kotlin.Boolean,kotlin.Function1,androidx.compose.ui.Modifier,kotlin.Function1)).

## Summary

|                                                                        ### Public constructors                                                                        |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----|
| [ExposedDropdownMenuBoxScope](https://developer.android.com/reference/kotlin/androidx/compose/material/ExposedDropdownMenuBoxScope#ExposedDropdownMenuBoxScope())`()` | Cmn |

|                                        ### Public functions                                        |
|----------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----|
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                      | `@`[Composable](https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable) [ExposedDropdownMenu](https://developer.android.com/reference/kotlin/androidx/compose/material/ExposedDropdownMenuBoxScope#ExposedDropdownMenu(kotlin.Boolean,kotlin.Function0,androidx.compose.ui.Modifier,androidx.compose.foundation.ScrollState,kotlin.Function1))`(` ` expanded: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`,` ` onDismissRequest: () `->` `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)`,` ` modifier: `[Modifier](https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier)`,` ` scrollState: `[ScrollState](https://developer.android.com/reference/kotlin/androidx/compose/foundation/ScrollState)`,` ` content: @`[Composable](https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable)` `[ColumnScope](https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/ColumnScope)`.() `->` `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) `)` Popup which contains content for Exposed Dropdown Menu. | Cmn |
| `abstract `[Modifier](https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier) | [Modifier](https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier)`.`[exposedDropdownSize](https://developer.android.com/reference/kotlin/androidx/compose/material/ExposedDropdownMenuBoxScope#(androidx.compose.ui.Modifier).exposedDropdownSize(kotlin.Boolean))`(matchTextFieldWidth: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`)` Modifier which should be applied to an[ExposedDropdownMenu](https://developer.android.com/reference/kotlin/androidx/compose/material/ExposedDropdownMenuBoxScope#ExposedDropdownMenu(kotlin.Boolean,kotlin.Function0,androidx.compose.ui.Modifier,androidx.compose.foundation.ScrollState,kotlin.Function1))placed inside the scope.                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | Cmn |

## Public constructors

### ExposedDropdownMenuBoxScope

Cmn  
Added in[1.7.0](https://developer.android.com/jetpack/androidx/releases/compose-material#1.7.0)  

```
ExposedDropdownMenuBoxScope()
```

## Public functions

### ExposedDropdownMenu

Cmn  
Added in[1.5.0](https://developer.android.com/jetpack/androidx/releases/compose-material#1.5.0)  

```
@Composable
fun ExposedDropdownMenu(
    expanded: Boolean,
    onDismissRequest: () -> Unit,
    modifier: Modifier = Modifier,
    scrollState: ScrollState = rememberScrollState(),
    content: @Composable ColumnScope.() -> Unit
): Unit
```

Popup which contains content for Exposed Dropdown Menu. Should be used inside the content of[ExposedDropdownMenuBox](https://developer.android.com/reference/kotlin/androidx/compose/material/package-summary#ExposedDropdownMenuBox(kotlin.Boolean,kotlin.Function1,androidx.compose.ui.Modifier,kotlin.Function1)).  

|                                                                                                                                                     Parameters                                                                                                                                                      |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `expanded: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                                                                                                                                                                                     | Whether the menu is currently open and visible to the user                                                                                                                                                                                                                               |
| `onDismissRequest: () `->` `[Unit](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: `[Modifier](https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier)` = Modifier`                                                                                                                                                                                                    | The modifier to apply to this layout                                                                                                                                                                                                                                                     |
| `scrollState: `[ScrollState](https://developer.android.com/reference/kotlin/androidx/compose/foundation/ScrollState)` = rememberScrollState()`                                                                                                                                                                      | a[ScrollState](https://developer.android.com/reference/kotlin/androidx/compose/foundation/ScrollState)to used by the menu's content for items vertical scrolling                                                                                                                         |
| `content: @`[Composable](https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable)` `[ColumnScope](https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/ColumnScope)`.() `->` `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | The content of the[ExposedDropdownMenu](https://developer.android.com/reference/kotlin/androidx/compose/material/ExposedDropdownMenuBoxScope#ExposedDropdownMenu(kotlin.Boolean,kotlin.Function0,androidx.compose.ui.Modifier,androidx.compose.foundation.ScrollState,kotlin.Function1)) |

### exposedDropdownSize

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

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

Modifier which should be applied to an[ExposedDropdownMenu](https://developer.android.com/reference/kotlin/androidx/compose/material/ExposedDropdownMenuBoxScope#ExposedDropdownMenu(kotlin.Boolean,kotlin.Function0,androidx.compose.ui.Modifier,androidx.compose.foundation.ScrollState,kotlin.Function1))placed inside the scope. It's responsible for setting the width of the[ExposedDropdownMenu](https://developer.android.com/reference/kotlin/androidx/compose/material/ExposedDropdownMenuBoxScope#ExposedDropdownMenu(kotlin.Boolean,kotlin.Function0,androidx.compose.ui.Modifier,androidx.compose.foundation.ScrollState,kotlin.Function1)), which will match the width of the[TextField](https://developer.android.com/reference/kotlin/androidx/compose/material/package-summary#TextField(androidx.compose.foundation.text.input.TextFieldState,androidx.compose.ui.Modifier,kotlin.Boolean,kotlin.Boolean,androidx.compose.ui.text.TextStyle,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,androidx.compose.foundation.ScrollState,androidx.compose.ui.graphics.Shape,androidx.compose.material.TextFieldColors,androidx.compose.foundation.interaction.MutableInteractionSource))(if[matchTextFieldWidth](https://developer.android.com/reference/kotlin/androidx/compose/material/ExposedDropdownMenuBoxScope#(androidx.compose.ui.Modifier).exposedDropdownSize(kotlin.Boolean))is set to true). Also it'll change the height of[ExposedDropdownMenu](https://developer.android.com/reference/kotlin/androidx/compose/material/ExposedDropdownMenuBoxScope#ExposedDropdownMenu(kotlin.Boolean,kotlin.Function0,androidx.compose.ui.Modifier,androidx.compose.foundation.ScrollState,kotlin.Function1)), so it'll take the largest possible height to not overlap the[TextField](https://developer.android.com/reference/kotlin/androidx/compose/material/package-summary#TextField(androidx.compose.foundation.text.input.TextFieldState,androidx.compose.ui.Modifier,kotlin.Boolean,kotlin.Boolean,androidx.compose.ui.text.TextStyle,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,androidx.compose.foundation.ScrollState,androidx.compose.ui.graphics.Shape,androidx.compose.material.TextFieldColors,androidx.compose.foundation.interaction.MutableInteractionSource))and the software keyboard.  

|                                                     Parameters                                                      |
|---------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------|
| `matchTextFieldWidth: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` = true` | Whether menu should match the width of the text field to which it's attached. If set to true the width will match the width of the text field. |