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


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


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

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


```kotlin
@ExperimentalMediaQueryApi
inline fun CompositionLocalAccessorScope.mediaQuery(query: UiMediaScope.() -> Boolean): Boolean
```


Evaluates a boolean query against the current `UiMediaScope` from a
`CompositionLocalAccessorScope`.

If called within a snapshot-aware context, the specific property reads within the query will be
tracked, and the scope will be invalidated when any of those properties change.

#### Parameters

| | |
| --- | --- |
| query | A lambda expression with `UiMediaScope` as its receiver, representing the condition to check. |


#### Returns

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






<hr class="docs-overload-divider">


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

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


```kotlin
@ExperimentalMediaQueryApi
inline fun CompositionLocalConsumerModifierNode.mediaQuery(
    query: UiMediaScope.() -> Boolean
): Boolean
```


Evaluates a boolean query against the current `UiMediaScope` from a `Modifier.Node`.

This function is designed to be used within a `Modifier.Node` that implements
`CompositionLocalConsumerModifierNode`.

If called within a snapshot-aware context like `LayoutModifierNode.measure` or
`DrawModifierNode.draw` callbacks, the reads within the query will be tracked, and the scope will
be invalidated when the properties change.

#### Parameters

| | |
| --- | --- |
| query | A lambda expression with `UiMediaScope` as its receiver, representing the condition to check. |


#### Returns

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