# SpatialDialogProperties

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/SpatialDialog.kt+class:androidx.xr.compose.spatial.SpatialDialogProperties) Added in [1.0.0-beta02](https://developer.android.com/jetpack/androidx/releases/xr-compose#1.0.0-beta02)


```
class SpatialDialogProperties
```

<br />

*** ** * ** ***

Properties for configuring a `https://developer.android.com/reference/kotlin/androidx/xr/compose/spatial/SpatialDialog.composable#SpatialDialog(kotlin.Function0,androidx.xr.compose.spatial.SpatialDialogProperties,kotlin.Function0)`.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/compose/spatial/SpatialDialog.composable#SpatialDialog(kotlin.Function0,androidx.xr.compose.spatial.SpatialDialogProperties,kotlin.Function0)` |   |

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/compose/spatial/SpatialDialogProperties#SpatialDialogProperties(kotlin.Boolean,kotlin.Boolean,kotlin.Boolean,androidx.compose.animation.core.FiniteAnimationSpec,androidx.compose.ui.unit.Dp)( dismissOnBackPress: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, dismissOnClickOutside: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, usePlatformDefaultWidth: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, backgroundContentAnimationSpec: https://developer.android.com/reference/kotlin/androidx/compose/animation/core/FiniteAnimationSpec<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html>, elevation: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp )` |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/compose/spatial/SpatialDialogProperties` | `https://developer.android.com/reference/kotlin/androidx/xr/compose/spatial/SpatialDialogProperties#copy(kotlin.Boolean,kotlin.Boolean,kotlin.Boolean,androidx.compose.animation.core.FiniteAnimationSpec,androidx.compose.ui.unit.Dp)( dismissOnBackPress: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, dismissOnClickOutside: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, usePlatformDefaultWidth: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, restingLevelAnimationSpec: https://developer.android.com/reference/kotlin/androidx/compose/animation/core/FiniteAnimationSpec<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html>, elevation: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp )` |
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/compose/spatial/SpatialDialogProperties#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/compose/spatial/SpatialDialogProperties#hashCode()()` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/compose/spatial/SpatialDialogProperties#toString()()` |

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/FiniteAnimationSpec<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html>` | `https://developer.android.com/reference/kotlin/androidx/xr/compose/spatial/SpatialDialogProperties#backgroundContentAnimationSpec()` the animation specification for the depth offset of the app content as it animates away from the user towards its recessed resting level when a spatial dialog is shown. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/compose/spatial/SpatialDialogProperties#dismissOnBackPress()` whether the dialog should be dismissed when the device's back button is pressed. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/compose/spatial/SpatialDialogProperties#dismissOnClickOutside()` whether the dialog should be dismissed when the user touches outside of it. |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | `https://developer.android.com/reference/kotlin/androidx/xr/compose/spatial/SpatialDialogProperties#elevation()` the elevation level of the dialog. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/compose/spatial/SpatialDialogProperties#usePlatformDefaultWidth()` whether the dialog should use the platform's default width. |

## Public constructors

### SpatialDialogProperties

Added in [1.0.0-beta02](https://developer.android.com/jetpack/androidx/releases/xr-compose#1.0.0-beta02)

```
SpatialDialogProperties(
    dismissOnBackPress: Boolean = true,
    dismissOnClickOutside: Boolean = true,
    usePlatformDefaultWidth: Boolean = true,
    backgroundContentAnimationSpec: FiniteAnimationSpec<Float> = spring(),
    elevation: Dp = SpatialElevationLevel.DialogDefault
)
```

## Public functions

### copy

Added in [1.0.0-beta02](https://developer.android.com/jetpack/androidx/releases/xr-compose#1.0.0-beta02)

```
fun copy(
    dismissOnBackPress: Boolean = this.dismissOnBackPress,
    dismissOnClickOutside: Boolean = this.dismissOnClickOutside,
    usePlatformDefaultWidth: Boolean = this.usePlatformDefaultWidth,
    restingLevelAnimationSpec: FiniteAnimationSpec<Float> = this.backgroundContentAnimationSpec,
    elevation: Dp = this.elevation
): SpatialDialogProperties
```

### equals

```
open operator fun equals(other: Any?): Boolean
```

### hashCode

```
open fun hashCode(): Int
```

### toString

```
open fun toString(): String
```

## Public properties

### backgroundContentAnimationSpec

Added in [1.0.0-beta02](https://developer.android.com/jetpack/androidx/releases/xr-compose#1.0.0-beta02)

```
val backgroundContentAnimationSpec: FiniteAnimationSpec<Float>
```

the animation specification for the depth offset of the app content as it animates away from the user towards its recessed resting level when a spatial dialog is shown. The same specification is used when the app content animates back towards the user to its original resting level when the dialog is dismissed. This is only used in spatial environments.

### dismissOnBackPress

Added in [1.0.0-beta02](https://developer.android.com/jetpack/androidx/releases/xr-compose#1.0.0-beta02)

```
val dismissOnBackPress: Boolean
```

whether the dialog should be dismissed when the device's back button is pressed. Defaults to `true`.

### dismissOnClickOutside

Added in [1.0.0-beta02](https://developer.android.com/jetpack/androidx/releases/xr-compose#1.0.0-beta02)

```
val dismissOnClickOutside: Boolean
```

whether the dialog should be dismissed when the user touches outside of it. Defaults to `true`.

### elevation

```
val elevation: Dp
```

the elevation level of the dialog. Defaults to `https://developer.android.com/reference/kotlin/androidx/xr/compose/spatial/SpatialElevationLevel#DialogDefault()`.

### usePlatformDefaultWidth

Added in [1.0.0-beta02](https://developer.android.com/jetpack/androidx/releases/xr-compose#1.0.0-beta02)

```
val usePlatformDefaultWidth: Boolean
```

whether the dialog should use the platform's default width. Defaults to `true`. This is only used in non-spatial environments.