<div class='type'>Composable Function</div>


<a id='references'></a>



<h2 id="mediaquery-query">mediaQuery</h2>

<div class='sourceset sourceset-common'>Common</div>


```kotlin
@ExperimentalMediaQueryApi
@Composable
@ReadOnlyComposable
fun mediaQuery(query: UiMediaScope.() -> Boolean): Boolean
```


Evaluates a boolean query against the current `UiMediaScope`.

Avoid reading properties marked with `@FrequentlyChangingValue` (such as
`UiMediaScope.windowWidth` or `UiMediaScope.windowHeight`) inside the `query` block. Reading
these properties will cause the composable to recompose on every frame during events such as
window resizing, which can affect the performance.

For queries involving such frequently changing values, use `derivedMediaQuery` instead.

#### Parameters

| | |
| --- | --- |
| query | The condition to evaluate against the `UiMediaScope`. |


#### Returns

| | |
| --- | --- |
|  | The boolean result of the query. |