# Modifier.Companion

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

  ```
  object Modifier.Companion : Modifier
  ```

*** ** * ** ***

The companion object `Modifier` is the empty, default, or starter `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier` that contains no `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier.Element`. Use it to create a new `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier` using modifier extension factory functions:

```kotlin
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Text
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp

Text(
    "Hello, World!",
    Modifier.padding(16.dp) // Outer padding; outside background
        .background(color = Color.Green) // Solid element background color
        .padding(16.dp), // Inner padding; inside background, around text
)
```

or as the default value for `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier` parameters:

```kotlin
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp

@Composable
fun PaddedColumn(modifier: Modifier = Modifier) {
    Column(modifier.padding(10.dp)) {
        // ...
    }
}
```

## 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#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#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#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#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 |
| `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 |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier#toString()()` | 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.

### then

Cmn

```
open infix fun then(other: Modifier): Modifier
```

Concatenates this modifier with another.

Returns a `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier` representing this modifier followed by `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier#then(androidx.compose.ui.Modifier)` in sequence.

### toString

Cmn

```
open fun toString(): String
```