# State

Artifact: [androidx.constraintlayout:constraintlayout-compose](https://developer.android.com/jetpack/androidx/releases/constraintlayout) [View Source](https://cs.android.com/search?q=file:androidx/constraintlayout/compose/ConstraintLayout.kt+class:androidx.constraintlayout.compose.State) Added in [1.1.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#1.1.2)


```
class State : State
```

<br />

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [androidx.constraintlayout.core.state.State](https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/State) ||
|   | ↳ | [androidx.constraintlayout.compose.State](https://developer.android.com/reference/kotlin/androidx/constraintlayout/compose/State) |

*** ** * ** ***

The state of the `https://developer.android.com/reference/kotlin/androidx/constraintlayout/compose/ConstraintLayout.composable#ConstraintLayout(androidx.compose.ui.Modifier,kotlin.Int,androidx.compose.animation.core.AnimationSpec,kotlin.Function0,kotlin.Function1)` solver.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/compose/State#State(androidx.compose.ui.unit.Density)(density: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density)` |

| ### Public functions |
|---|---|
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/compose/State#convertDimension(kotlin.Any)(value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` Implements a conversion function for values, returning int. |

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/compose/State#density()` |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/LayoutDirection` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/compose/State#layoutDirection()` **This property is deprecated.** Use #isLtr instead |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Constraints` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/compose/State#rootIncomingConstraints()` |

### Inherited functions

From [androidx.constraintlayout.core.state.State](https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/State) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/State#apply(androidx.constraintlayout.core.widgets.ConstraintWidgetContainer)(container: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/widgets/ConstraintWidgetContainer)` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/helpers/BarrierReference` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/State#barrier(java.lang.Object,androidx.constraintlayout.core.state.State.Direction)(key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html, direction: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/State.Direction)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/State#baselineNeededFor(java.lang.Object)(id: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`

Baseline is needed for this object
`https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/helpers/AlignHorizontallyReference` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/State#centerHorizontally(java.lang.Object...)(vararg references: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/helpers/AlignVerticallyReference` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/State#centerVertically(java.lang.Object...)(vararg references: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/State#constraints(java.lang.Object)(key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/State#createConstraintReference(java.lang.Object)(key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`

Create a new reference given a key.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/State#directMapping()()` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/helpers/FlowReference` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/State#getFlow(java.lang.Object,boolean)(key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html, vertical: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`

Gets a reference to a Flow object.
`https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/helpers/GridReference` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/State#getGrid(java.lang.Object,java.lang.String)(key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html, gridType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`

Get a Grid reference
`https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/helpers/FlowReference` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/State#getHorizontalFlow(java.lang.Object...)(vararg references: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`

Get a HorizontalFlowReference and add it to references
`https://developer.android.com/reference/java/util/ArrayList.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html>` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/State#getIdsForTag(java.lang.String)(tag: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/helpers/FlowReference` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/State#getVerticalFlow(java.lang.Object...)(vararg references: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`

Get a VerticalFlowReference and add it to references
`https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/helpers/GuidelineReference` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/State#guideline(java.lang.Object,int)(key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html, orientation: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/State` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/State#height(androidx.constraintlayout.core.state.Dimension)(dimension: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/Dimension)` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/HelperReference` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/State#helper(java.lang.Object,androidx.constraintlayout.core.state.State.Helper)(key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html, type: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/State.Helper)` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/helpers/HorizontalChainReference` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/State#horizontalChain()()` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/helpers/HorizontalChainReference` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/State#horizontalChain(java.lang.Object...)(vararg references: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/helpers/GuidelineReference` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/State#horizontalGuideline(java.lang.Object)(key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/State#isBaselineNeeded(androidx.constraintlayout.core.widgets.ConstraintWidget)(constraintWidget: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/widgets/ConstraintWidget)`

Does this constraintWidget need a baseline
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/State#map(java.lang.Object,java.lang.Object)(key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html, view: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/State#reset()()`

Clear the state
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/State#sameFixedHeight(int)(height: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/State#sameFixedWidth(int)(width: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/State` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/State#setHeight(androidx.constraintlayout.core.state.Dimension)(dimension: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/Dimension)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/State#setTag(java.lang.String,java.lang.String)(key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, tag: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/State` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/State#setWidth(androidx.constraintlayout.core.state.Dimension)(dimension: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/Dimension)` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/helpers/VerticalChainReference` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/State#verticalChain()()` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/helpers/VerticalChainReference` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/State#verticalChain(java.lang.Object...)(vararg references: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/helpers/GuidelineReference` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/State#verticalGuideline(java.lang.Object)(key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/State` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/State#width(androidx.constraintlayout.core.state.Dimension)(dimension: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/Dimension)`

### Inherited properties

From [androidx.constraintlayout.core.state.State](https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/State) `open https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/CorePixelDp!` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/State#dpToPixel()` `open https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/helpers/FlowReference` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/State#horizontalFlow()` `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/State#isLtr()`

**This property is deprecated.** Deprecated in Java
`open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/State#isRtl()` `https://developer.android.com/reference/java/util/HashMap.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html, https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/HelperReference>` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/State#mHelperReferences()` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/State#mParent()` `https://developer.android.com/reference/java/util/HashMap.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html, https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/Reference>` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/State#mReferences()` `open https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/helpers/FlowReference` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/state/State#verticalFlow()`

## Public constructors

### State

Added in [1.1.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#1.1.2)

```
State(density: Density)
```

## Public functions

### convertDimension

```
open fun convertDimension(value: Any?): Int
```

Implements a conversion function for values, returning int. This can be used in case values (e.g. margins) are represented via an object, not directly an int.

| Parameters |
|---|---|
| `value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?` | the object to convert from |

## Public properties

### density

Added in [1.1.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#1.1.2)

```
val density: Density
```

### layoutDirection

Added in [1.1.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#1.1.2) Deprecated in [1.1.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#1.1.2)

```
var layoutDirection: LayoutDirection
```

> [!CAUTION]
> **This property is deprecated.**   
> Use #isLtr instead

### rootIncomingConstraints

Added in [1.1.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#1.1.2)

```
var rootIncomingConstraints: Constraints
```