# inspectable

Common/AllAndroid/JVM

## Functions summary

|---|---|---|
| `inline https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier.[inspectable](https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/inspectable.modifier#(androidx.compose.ui.Modifier).inspectable(kotlin.Function1,kotlin.Function1))( noinline inspectorInfo: https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/InspectorInfo.() -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html, factory: https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier.() -> https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier )` **This function is deprecated.** This API will create more invalidations of your modifier than necessary, so it's use is discouraged. | Cmn |

## Functions

### Modifier.inspectable

Cmn 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/platform/InspectableValue.kt+function:inspectable)

```
inline fun Modifier.[inspectable](https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/inspectable.modifier#(androidx.compose.ui.Modifier).inspectable(kotlin.Function1,kotlin.Function1))(
    noinline inspectorInfo: InspectorInfo.() -> Unit,
    factory: Modifier.() -> Modifier
): Modifier
```

> [!CAUTION]
> **This function is deprecated.**   
> This API will create more invalidations of your modifier than necessary, so it's use is discouraged. Implementing the inspectableProperties method on ModifierNodeElement is the recommended zero-cost alternative to exposing properties on a Modifier to tooling.

Use this to group a common set of modifiers and provide `https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/InspectorInfo` for the resulting modifier.

```kotlin
import androidx.compose.foundation.background
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.debugInspectorInfo
import androidx.compose.ui.platform.inspectable
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp

/** Sample with a single parameter */
fun Modifier.simpleFrame(color: Color) =
    inspectable(
        inspectorInfo =
            debugInspectorInfo {
                name = "simpleFrame"
                value = color
            }
    ) {
        background(color, RoundedCornerShape(5.0.dp))
    }

/** Sample with multiple parameters */
fun Modifier.fancyFrame(size: Dp, color: Color) =
    inspectable(
        inspectorInfo =
            debugInspectorInfo {
                name = "fancyFrame"
                properties["size"] = size
                properties["color"] = color
            }
    ) {
        background(color, RoundedCornerShape(size))
    }
```