---
title: "preferKeepClear"
description: "Mark the layout rectangle as preferring to stay clear of floating windows.

This Modifier only has an effect on SDK 33 and above."
type: "modifier"
---

<div class='type'>Compose Modifier</div>

<a id='references'></a>
<div class='sourceset sourceset-android'>Android</div>


```kotlin
fun Modifier.preferKeepClear() =
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) {
        this
    } else {
        this then preferKeepClearT(null)
    }
```


Mark the layout rectangle as preferring to stay clear of floating windows.

This Modifier only has an effect on SDK 33 and above.



<div class='sourceset sourceset-android'>Android</div>


```kotlin
fun Modifier.preferKeepClear(rectProvider: (LayoutCoordinates) -> Rect) =
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) {
        this
    } else {
        this then preferKeepClearT(rectProvider)
    }
```


Mark a rectangle within the local layout coordinates preferring to stay clear of floating
windows. After layout, `rectProvider` is called to determine the `Rect` to mark as keep clear.

The `LayoutCoordinates` of the `Modifier`'s location in the layout is passed as `rectProvider`'s
parameter.

This Modifier only has an effect on SDK 33 and above.



