# Modifier.Element

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/Modifier.kt+class:androidx.compose.ui.Modifier.Element) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0) Common/AllAndroid/JVM
- Cmn

  ```
  interface Modifier.Element : Modifier
  ```
Known direct subclasses [DrawModifier](https://developer.android.com/reference/kotlin/androidx/compose/ui/draw/DrawModifier), [FocusEventModifier](https://developer.android.com/reference/kotlin/androidx/compose/ui/focus/FocusEventModifier), [FocusOrderModifier](https://developer.android.com/reference/kotlin/androidx/compose/ui/focus/FocusOrderModifier), [FocusRequesterModifier](https://developer.android.com/reference/kotlin/androidx/compose/ui/focus/FocusRequesterModifier), [InspectableModifier.End](https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/InspectableModifier.End), [InspectableModifier](https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/InspectableModifier), [LayoutModifier](https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/LayoutModifier), [ModifierLocalConsumer](https://developer.android.com/reference/kotlin/androidx/compose/ui/modifier/ModifierLocalConsumer), [ModifierLocalProvider](https://developer.android.com/reference/kotlin/androidx/compose/ui/modifier/ModifierLocalProvider), [ModifierNodeElement](https://developer.android.com/reference/kotlin/androidx/compose/ui/node/ModifierNodeElement), [OnGloballyPositionedModifier](https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/OnGloballyPositionedModifier), [OnPlacedModifier](https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/OnPlacedModifier), [OnRemeasuredModifier](https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/OnRemeasuredModifier), [ParentDataModifier](https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/ParentDataModifier), [PointerInputModifier](https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerInputModifier), [RemeasurementModifier](https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/RemeasurementModifier), [SemanticsModifier](https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsModifier)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/draw/DrawModifier` | A `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier.Element` that draws into the space of the layout. |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/focus/FocusEventModifier` | **This interface is deprecated.** Use FocusEventModifierNode instead |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/focus/FocusOrderModifier` | **This interface is deprecated.** Use Modifier.focusProperties() instead |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/focus/FocusRequesterModifier` | **This interface is deprecated.** Use FocusRequesterModifierNode instead |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/InspectableModifier.End` | **This class is deprecated.** This API will create more invalidations of your modifier than necessary, so it's use is discouraged. |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/InspectableModifier` | **This class is deprecated.** This API will create more invalidations of your modifier than necessary, so it's use is discouraged. |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/LayoutModifier` | A `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier.Element` that changes how its wrapped content is measured and laid out. |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/modifier/ModifierLocalConsumer` | A Modifier that can be used to consume `https://developer.android.com/reference/kotlin/androidx/compose/ui/modifier/ModifierLocal`s that were provided by other modifiers to the left of this modifier, or above this modifier in the layout tree. |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/modifier/ModifierLocalProvider` | A Modifier that can be used to provide `https://developer.android.com/reference/kotlin/androidx/compose/ui/modifier/ModifierLocal`s that can be read by other modifiers to the right of this modifier, or modifiers that are children of the layout node that this modifier is attached to. |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/node/ModifierNodeElement` | A `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier.Element` which manages an instance of a particular `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier.Node` implementation. |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/OnGloballyPositionedModifier` | A modifier whose `https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/OnGloballyPositionedModifier#onGloballyPositioned(androidx.compose.ui.layout.LayoutCoordinates)` is called with the final LayoutCoordinates of the Layout when the global position of the content may have changed. |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/OnPlacedModifier` | A modifier whose `https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/OnPlacedModifier#onPlaced(androidx.compose.ui.layout.LayoutCoordinates)` is called after the parent `https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/LayoutModifier` and parent layout has been placed and before child `https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/LayoutModifier` is placed. |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/OnRemeasuredModifier` | A modifier whose `https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/OnRemeasuredModifier#onRemeasured(androidx.compose.ui.unit.IntSize)` is called when the layout content is remeasured. |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/ParentDataModifier` | A `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier` that provides data to the parent `https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/Layout.composable#Layout(kotlin.Function0,androidx.compose.ui.Modifier,androidx.compose.ui.layout.MeasurePolicy)`. |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerInputModifier` | A `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier.Element` that can interact with pointer input. |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/RemeasurementModifier` | A `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier.Element` that provides a `https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/Remeasurement` object associated with the layout node the modifier is applied to. |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsModifier` | A `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier.Element` that adds semantics key/value for use in testing, accessibility, and similar use cases. |

Known indirect subclasses [DrawCacheModifier](https://developer.android.com/reference/kotlin/androidx/compose/ui/draw/DrawCacheModifier)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/draw/DrawCacheModifier` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/draw/DrawModifier` implementation that supports building a cache of objects to be referenced across draw calls |

*** ** * ** ***

A single element contained within a `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier` chain.

## Summary

| ### Public functions |
|---|---|---|
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier.Element#all(kotlin.Function1)(predicate: (https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier.Element) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Returns `true` if `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier#all(kotlin.Function1)` returns true for all `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier.Element`s in this `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier` or if this `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier` contains no `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier.Element`s. | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier.Element#any(kotlin.Function1)(predicate: (https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier.Element) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Returns `true` if `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier#any(kotlin.Function1)` returns true for any `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier.Element` in this `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier`. | Cmn |
| `open R` | `<R : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?> https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier.Element#foldIn(kotlin.Any,kotlin.Function2)(initial: R, operation: (https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier.Element, R) -> R)` Accumulates a value starting with `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier#foldIn(kotlin.Any,kotlin.Function2)` and applying `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier#foldIn(kotlin.Any,kotlin.Function2)` to the current value and each element from outside in. | Cmn |
| `open R` | `<R : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?> https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier.Element#foldOut(kotlin.Any,kotlin.Function2)(initial: R, operation: (https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier.Element, R) -> R)` Accumulates a value starting with `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier#foldOut(kotlin.Any,kotlin.Function2)` and applying `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier#foldOut(kotlin.Any,kotlin.Function2)` to the current value and each element from inside out. | Cmn |

| ### Inherited functions |
|---|
| From [androidx.compose.ui.Modifier](https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier) |---|---|---| | `open infix https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier#then(androidx.compose.ui.Modifier)(other: https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier)` Concatenates this modifier with another. | Cmn | |

## Public functions

### all

Cmn

```
open fun all(predicate: (Modifier.Element) -> Boolean): Boolean
```

Returns `true` if `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier#all(kotlin.Function1)` returns true for all `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier.Element`s in this `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier` or if this `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier` contains no `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier.Element`s.

### any

Cmn

```
open fun any(predicate: (Modifier.Element) -> Boolean): Boolean
```

Returns `true` if `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier#any(kotlin.Function1)` returns true for any `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier.Element` in this `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier`.

### foldIn

Cmn

```
open fun <R : Any?> foldIn(initial: R, operation: (Modifier.Element, R) -> R): R
```

Accumulates a value starting with `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier#foldIn(kotlin.Any,kotlin.Function2)` and applying `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier#foldIn(kotlin.Any,kotlin.Function2)` to the current value and each element from outside in.

Elements wrap one another in a chain from left to right; an `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier.Element` that appears to the left of another in a `+` expression or in `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier#foldIn(kotlin.Any,kotlin.Function2)`'s parameter order affects all of the elements that appear after it. `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier#foldIn(kotlin.Any,kotlin.Function2)` may be used to accumulate a value starting from the parent or head of the modifier chain to the final wrapped child.

### foldOut

Cmn

```
open fun <R : Any?> foldOut(initial: R, operation: (Modifier.Element, R) -> R): R
```

Accumulates a value starting with `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier#foldOut(kotlin.Any,kotlin.Function2)` and applying `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier#foldOut(kotlin.Any,kotlin.Function2)` to the current value and each element from inside out.

Elements wrap one another in a chain from left to right; an `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier.Element` that appears to the left of another in a `+` expression or in `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier#foldOut(kotlin.Any,kotlin.Function2)`'s parameter order affects all of the elements that appear after it. `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier#foldOut(kotlin.Any,kotlin.Function2)` may be used to accumulate a value starting from the child or tail of the modifier chain up to the parent or head of the chain.