# SpatialPopup

## Functions summary

|---|---|
| `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/xr/compose/spatial/SpatialPopup.composable#SpatialPopup(androidx.compose.ui.Alignment,androidx.compose.ui.unit.IntOffset,kotlin.Function0,androidx.compose.ui.unit.Dp,androidx.compose.ui.window.PopupProperties,kotlin.Function0)( alignment: https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment, offset: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntOffset, onDismissRequest: (() -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)?, elevation: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp, properties: https://developer.android.com/reference/kotlin/androidx/compose/ui/window/PopupProperties, content: @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html )` A composable that creates a panel in 3D space to hoist Popup based composables. |

## Functions

### SpatialPopup

Artifact: [androidx.xr.compose:compose](https://developer.android.com/jetpack/androidx/releases/xr-compose) [View Source](https://cs.android.com/search?q=file:androidx/xr/compose/spatial/SpatialPopup.kt+function:SpatialPopup) Added in [1.0.0-beta02](https://developer.android.com/jetpack/androidx/releases/xr-compose#1.0.0-beta02)

```
@Composable
fun SpatialPopup(
    alignment: Alignment = Alignment.TopStart,
    offset: IntOffset = IntOffset(0, 0),
    onDismissRequest: (() -> Unit)? = null,
    elevation: Dp = SpatialElevationLevel.Level3,
    properties: PopupProperties = PopupProperties(),
    content: @Composable () -> Unit
): Unit
```

A composable that creates a panel in 3D space to hoist Popup based composables.

In non-spatialized environments or embedded activities, a standard Compose `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/Popup.composable#Popup(androidx.compose.ui.Alignment,androidx.compose.ui.unit.IntOffset,kotlin.Function0,androidx.compose.ui.window.PopupProperties,kotlin.Function0)` is utilized to display the content.

| Parameters |
|---|---|
| `alignment: https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment = Alignment.TopStart` | the alignment of the popup relative to its parent. |
| `offset: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntOffset = IntOffset(0, 0)` | An offset from the original aligned position of the popup. Offset respects the Ltr/Rtl context, thus in Ltr it will be added to the original aligned position and in Rtl it will be subtracted from it. |
| `onDismissRequest: (() -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)? = null` | callback invoked when the user requests to dismiss the popup (e.g., by clicking outside). |
| `elevation: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp = SpatialElevationLevel.Level3` | the elevation value of the SpatialPopUp. |
| `properties: https://developer.android.com/reference/kotlin/androidx/compose/ui/window/PopupProperties = PopupProperties()` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/PopupProperties` configuration properties for further customization of this popup's behavior. |
| `content: @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | the composable content to be displayed within the popup. |