# DialogProperties

Artifact: [androidx.compose.ui:ui](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/window/+class:androidx.compose.ui.window.DialogProperties) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0) Common/AllAndroid/JVM
- Cmn

  ```
  class DialogProperties
  ```

*** ** * ** ***

Properties used to customize the behavior of a `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/Dialog.composable#Dialog(kotlin.Function0,androidx.compose.ui.window.DialogProperties,kotlin.Function0)`.

## Summary

| ### Public constructors |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/DialogProperties#DialogProperties()()` | android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/DialogProperties#DialogProperties(kotlin.Boolean,kotlin.Boolean,kotlin.Boolean)( 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 )` | Cmn android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/DialogProperties#DialogProperties(kotlin.Boolean,kotlin.Boolean,androidx.compose.ui.window.SecureFlagPolicy,kotlin.Boolean,kotlin.Boolean,kotlin.String,kotlin.Int,android.os.IBinder,androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp,kotlin.Float,androidx.compose.ui.graphics.Shape)( dismissOnBackPress: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, dismissOnClickOutside: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, securePolicy: https://developer.android.com/reference/kotlin/androidx/compose/ui/window/SecureFlagPolicy, usePlatformDefaultWidth: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, decorFitsSystemWindows: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, windowTitle: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, windowType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, windowToken: https://developer.android.com/reference/android/os/IBinder.html?, blurBehindRadius: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp, backgroundBlurRadius: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp, scrimAlpha: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, windowShape: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Shape? )` | android |

| ### Public functions |
|---|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/DialogProperties#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` | android |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/DialogProperties#hashCode()()` | android |

| ### Public properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/DialogProperties#backgroundBlurRadius()` Blurs the screen behind the window within the bounds of the window. | android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/DialogProperties#blurBehindRadius()` Blurs the screen behind the window. | android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/DialogProperties#decorFitsSystemWindows()` Sets `https://developer.android.com/reference/kotlin/androidx/core/view/WindowCompat#setDecorFitsSystemWindows(android.view.Window,boolean)` value. | android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/DialogProperties#dismissOnBackPress()` whether the popup can be dismissed by pressing the back or escape buttons on Android or the escape key on desktop. | Cmn android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/DialogProperties#dismissOnClickOutside()` whether the dialog can be dismissed by clicking outside the dialog's bounds. | Cmn android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/DialogProperties#scrimAlpha()` The opacity of the scrim (also known as dimming) applied behind the dialog window. | android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/SecureFlagPolicy` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/DialogProperties#securePolicy()` Policy for setting `https://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#FLAG_SECURE` on the dialog's window. | android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/DialogProperties#usePlatformDefaultWidth()` Whether the width of the dialog's content should be limited to the platform default, which is smaller than the screen width. | Cmn android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Shape?` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/DialogProperties#windowShape()` The `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Shape` applied to the underlying native dialog window background. | android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/DialogProperties#windowTitle()` Title to be set on the dialog's window. | android |
| `https://developer.android.com/reference/android/os/IBinder.html?` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/DialogProperties#windowToken()` An optional `https://developer.android.com/reference/android/os/IBinder.html` to be used as the window token for the dialog window. | android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/DialogProperties#windowType()` An optional `https://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#type` to apply to the dialog's underlying `https://developer.android.com/reference/android/view/Window.html`. | android |

## Public constructors

### DialogProperties

android Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.8.0)

```
DialogProperties()
```

### DialogProperties

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

```
DialogProperties(
    dismissOnBackPress: Boolean = true,
    dismissOnClickOutside: Boolean = true,
    usePlatformDefaultWidth: Boolean = true
)
```

### DialogProperties

android Added in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.13.0-rc01)

```
DialogProperties(
    dismissOnBackPress: Boolean = true,
    dismissOnClickOutside: Boolean = true,
    securePolicy: SecureFlagPolicy = SecureFlagPolicy.Inherit,
    usePlatformDefaultWidth: Boolean = true,
    decorFitsSystemWindows: Boolean = true,
    windowTitle: String = "",
    windowType: Int = WindowManager.LayoutParams.TYPE_APPLICATION,
    windowToken: IBinder? = null,
    blurBehindRadius: Dp = Dp.Unspecified,
    backgroundBlurRadius: Dp = Dp.Unspecified,
    scrimAlpha: Float = Float.NaN,
    windowShape: Shape? = null
)
```

## Public functions

### equals

android

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

### hashCode

android

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

## Public properties

### backgroundBlurRadius

android

```
val backgroundBlurRadius: Dp
```

Blurs the screen behind the window within the bounds of the window. The density of the blur is set by the blur radius. The radius defines the size of the neighboring area, from which pixels will be averaged to form the final color for each pixel. The operation approximates a Gaussian blur. A radius of `0.dp` means no blur. The higher the radius, the denser the blur. The window background drawable is drawn on top of the blurred region. The blur region bounds and rounded corners will mimic those of the background drawable. Note the difference with `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/DialogProperties#blurBehindRadius()`, which blurs the whole screen behind the window. Background blur blurs the screen behind only within the bounds of the window. For background blur, a radius of `30.dp` (\~80 px) creates a good frosted-glass effect. Avoid blur radii higher than `50.dp` (\~150 px), as this will significantly impact performance. Some devices might not support cross-window blur due to GPU limitations. It can also be disabled by the system at runtime (e.g. during battery saving mode). In such situations, no blur will be computed or drawn. Supported on Android 12 (`https://developer.android.com/reference/android/os/Build.VERSION_CODES.html#S`) and above. If the dialog content uses rounded corners, set `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/DialogProperties#windowShape()` to match it so the background blur clips to the rounded corners of the dialog card instead of the default rectangular window bounds.

### blurBehindRadius

android

```
val blurBehindRadius: Dp
```

Blurs the screen behind the window. The effect is similar to that of `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/DialogProperties#scrimAlpha()`, but instead of having a scrim applied, the content behind the window will be blurred (or combined with the scrim opacity, if such is specified). The density of the blur is set by the blur radius. The radius defines the size of the neighboring area, from which pixels will be averaged to form the final color for each pixel. The operation approximates a Gaussian blur. A radius of `0.dp` means no blur. The higher the radius, the denser the blur. Note the difference with `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/DialogProperties#backgroundBlurRadius()`, which blurs only within the bounds of the window. Blur behind blurs the whole screen behind the window. For blur behind, a radius of `10.dp` (\~20 px) creates a good depth-of-field effect. Avoid blur radii higher than `50.dp` (\~150 px), as this will significantly impact performance. Some devices might not support cross-window blur due to GPU limitations. It can also be disabled by the system at runtime (e.g. during battery saving mode). In such situations, no blur will be computed or drawn. Supported on Android 12 (`https://developer.android.com/reference/android/os/Build.VERSION_CODES.html#S`) and above.

### decorFitsSystemWindows

android Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.3.0)

```
val decorFitsSystemWindows: Boolean
```

Sets `https://developer.android.com/reference/kotlin/androidx/core/view/WindowCompat#setDecorFitsSystemWindows(android.view.Window,boolean)` value. Set to `false` to use WindowInsets. If `false`, the `https://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#softInputMode` will be changed to `https://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#SOFT_INPUT_ADJUST_RESIZE` on `https://developer.android.com/reference/android/os/Build.VERSION_CODES.html#R` and below and `https://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#SOFT_INPUT_ADJUST_NOTHING` on `https://developer.android.com/reference/android/os/Build.VERSION_CODES.html#S` and above. `https://developer.android.com/reference/android/view/Window.html#isFloating()` will be `false` when `decorFitsSystemWindows` is `false`.

### dismissOnBackPress

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

```
val dismissOnBackPress: Boolean
```

whether the popup can be dismissed by pressing the back or escape buttons on Android or the escape key on desktop. If true, pressing the back button will call onDismissRequest.

### dismissOnClickOutside

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

```
val dismissOnClickOutside: Boolean
```

whether the dialog can be dismissed by clicking outside the dialog's bounds. If true, clicking outside the dialog will call onDismissRequest.

### scrimAlpha

android Added in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.13.0-rc01)

```
val scrimAlpha: Float
```

The opacity of the scrim (also known as dimming) applied behind the dialog window. Ranging from 0.0f (no scrim) to 1.0f (completely opaque). By default, this value is `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/-companion/-na-n.html`, which means the dialog retains the standard system dialog behavior with the default scrim opacity defined by the window theme.

### securePolicy

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

```
val securePolicy: SecureFlagPolicy
```

Policy for setting `https://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#FLAG_SECURE` on the dialog's window.

### usePlatformDefaultWidth

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

```
val usePlatformDefaultWidth: Boolean
```

Whether the width of the dialog's content should be limited to the platform default, which is smaller than the screen width. **Might be used only as named argument**.

### windowShape

android Added in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.13.0-rc01)

```
val windowShape: Shape?
```

The `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Shape` applied to the underlying native dialog window background. This defines the geometric outline of the window frame. When set (e.g., `RoundedCornerShape` or `CircleShape`), window-level hardware effects such as `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/DialogProperties#backgroundBlurRadius()` will clip to this shape instead of standard 90-degree rectangular bounds. Use this to align the background blur outline with the rounded shape of your dialog content card. If `null` (default), the window background uses standard rectangular bounds.

Example usage:

### windowTitle

android Added in [1.9.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.9.0)

```
val windowTitle: String
```

Title to be set on the dialog's window.

### windowToken

android Added in [1.11.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.11.0)

```
val windowToken: IBinder?
```

An optional `https://developer.android.com/reference/android/os/IBinder.html` to be used as the window token for the dialog window. If null, the dialog will typically derive the token from the context. This parameter is crucial for scenarios where the dialog is shown from a context without a suitable default token, such as a Service running in a separate process from the main application. In such cross-process cases, the token from the main application's window should be provided. The provided token must be a valid `https://developer.android.com/reference/android/os/IBinder.html` from an existing window and must have the necessary permissions to add windows of the specified `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/DialogProperties#windowType()`. Providing an invalid, stale, or permission-denied token will typically result in a `https://developer.android.com/reference/android/view/WindowManager.BadTokenException.html` when the dialog attempts to show.

### windowType

android Added in [1.11.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.11.0)

```
val windowType: Int
```

An optional `https://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#type` to apply to the dialog's underlying `https://developer.android.com/reference/android/view/Window.html`. The default value is `https://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#TYPE_APPLICATION`, which is the platform's standard dialog window type. Overriding this allows you to change the layer or behavior of the dialog. For example, setting it to `https://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#TYPE_APPLICATION_OVERLAY` allows the dialog to draw on top of other applications (requires the `https://developer.android.com/reference/android/Manifest.permission.html#SYSTEM_ALERT_WINDOW` permission). Note: If you are displaying a dialog from a non-Activity context (such as an `https://developer.android.com/reference/android/app/Service.html`) but still want it to be anchored to an existing application window, you should leave this as the default type and instead provide the `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/DialogProperties#windowToken()` of the target application window.