androidx.compose.ui

composed

Function · from org.jetbrains.compose.ui:ui:1.12.2

No hand-written docs yet.

Declare a just-in-time composition of a Modifier that will be composed for each element it modifies. composed may be used to implement stateful modifiers that have instance-specific state for each modified element, allowing the same Modifier instance to be safely reused for multiple elements while maintaining element-specific state.

Form 1

fun Modifier.composed(
    inspectorInfo: InspectorInfo.() -> Unit = NoInspectorInfo,
    factory: @Composable Modifier.() -> Modifier,
): Modifier

inspectorInfo: InspectorInfo.() -> UnitOptional

Default: NoInspectorInfo

Not described.

factory: @Composable Modifier.() -> ModifierRequired

Not described.

Form 2

fun Modifier.composed(
    fullyQualifiedName: String,
    key1: Any?,
    inspectorInfo: InspectorInfo.() -> Unit = NoInspectorInfo,
    factory: @Composable Modifier.() -> Modifier,
): Modifier

fullyQualifiedName: StringRequired

Not described.

key1: Any?Required

Not described.

Same as above: inspectorInfo, factory.

Form 3

fun Modifier.composed(
    fullyQualifiedName: String,
    key1: Any?,
    key2: Any?,
    inspectorInfo: InspectorInfo.() -> Unit = NoInspectorInfo,
    factory: @Composable Modifier.() -> Modifier,
): Modifier

key2: Any?Required

Not described.

Same as above: fullyQualifiedName, key1, inspectorInfo, factory.

With key3

fun Modifier.composed(
    fullyQualifiedName: String,
    key1: Any?,
    key2: Any?,
    key3: Any?,
    inspectorInfo: InspectorInfo.() -> Unit = NoInspectorInfo,
    factory: @Composable Modifier.() -> Modifier,
): Modifier

key3: Any?Required

Not described.

Same as above: fullyQualifiedName, key1, key2, inspectorInfo, factory.

With keys

fun Modifier.composed(
    fullyQualifiedName: String,
    vararg keys: Any?,
    inspectorInfo: InspectorInfo.() -> Unit = NoInspectorInfo,
    factory: @Composable Modifier.() -> Modifier,
): Modifier

keys: Any?Required

Not described.

Same as above: fullyQualifiedName, inspectorInfo, factory.

Library docs

Declare a just-in-time composition of a Modifier that will be composed for each element it modifies. composed may be used to implement stateful modifiers that have instance-specific state for each modified element, allowing the same Modifier instance to be safely reused for multiple elements while maintaining element-specific state.

If inspectorInfo is specified this modifier will be visible to tools during development. Specify the name and arguments of the original modifier.

Example usage: