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


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



<h2 id="derivedmediaquery-query">derivedMediaQuery</h2>

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


```kotlin
@ExperimentalMediaQueryApi
@Composable
fun derivedMediaQuery(query: UiMediaScope.() -> Boolean): State<Boolean>
```


Evaluates a boolean query against the current `UiMediaScope`, wrapped in a `derivedStateOf`.

Use this function for queries that involve frequently changing values, such as
`UiMediaScope.windowWidth` or `UiMediaScope.windowHeight`. It ensures that compositions only
recompose when the boolean result of the `query` changes, not on every small change to the
underlying values (like a 1px size change).

For queries on stable properties, you can use the simpler `mediaQuery` function.

#### Parameters

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


#### Returns

| | |
| --- | --- |
|  | A `State` holding the boolean result of the query. The state will only update when the evaluated result of the query changes. |