# Alignment

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

  ```
  fun interface Alignment
  ```
Known direct subclasses [BiasAbsoluteAlignment](https://developer.android.com/reference/kotlin/androidx/compose/ui/BiasAbsoluteAlignment), [BiasAlignment](https://developer.android.com/reference/kotlin/androidx/compose/ui/BiasAlignment)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/BiasAbsoluteAlignment` | An `https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment` specified by bias: for example, a bias of -1 represents alignment to the left/top, a bias of 0 will represent centering, and a bias of 1 will represent right/bottom. |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/BiasAlignment` | An `https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment` specified by bias: for example, a bias of -1 represents alignment to the start/top, a bias of 0 will represent centering, and a bias of 1 will represent end/bottom. |

*** ** * ** ***

An interface to calculate the position of a sized box inside an available space. `https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment` is often used to define the alignment of a layout inside a parent layout.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/AbsoluteAlignment` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/BiasAlignment` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/BiasAbsoluteAlignment` |   |

## Summary

| ### Nested types |
|---|
| `fun interface https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment.Horizontal` An interface to calculate the position of box of a certain width inside an available width. |
| `fun interface https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment.Vertical` An interface to calculate the position of a box of a certain height inside an available height. |

| ### Public companion properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment.Vertical` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment#Bottom()` | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment#BottomCenter()` | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment#BottomEnd()` | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment#BottomStart()` | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment#Center()` | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment#CenterEnd()` | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment.Horizontal` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment#CenterHorizontally()` | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment#CenterStart()` | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment.Vertical` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment#CenterVertically()` | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment.Horizontal` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment#End()` | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment.Horizontal` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment#Start()` | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment.Vertical` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment#Top()` | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment#TopCenter()` | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment#TopEnd()` | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment#TopStart()` | Cmn |

| ### Public functions |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntOffset` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment#align(androidx.compose.ui.unit.IntSize,androidx.compose.ui.unit.IntSize,androidx.compose.ui.unit.LayoutDirection)(size: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize, space: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize, layoutDirection: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/LayoutDirection)` Calculates the position of a box of size `https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment#align(androidx.compose.ui.unit.IntSize,androidx.compose.ui.unit.IntSize,androidx.compose.ui.unit.LayoutDirection)` relative to the top left corner of an area of size `https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment#align(androidx.compose.ui.unit.IntSize,androidx.compose.ui.unit.IntSize,androidx.compose.ui.unit.LayoutDirection)`. | Cmn |

## Public companion properties

### Bottom

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val Bottom: Alignment.Vertical
```

### BottomCenter

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val BottomCenter: Alignment
```

### BottomEnd

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val BottomEnd: Alignment
```

### BottomStart

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val BottomStart: Alignment
```

### Center

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val Center: Alignment
```

### CenterEnd

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val CenterEnd: Alignment
```

### CenterHorizontally

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val CenterHorizontally: Alignment.Horizontal
```

### CenterStart

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val CenterStart: Alignment
```

### CenterVertically

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val CenterVertically: Alignment.Vertical
```

### End

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val End: Alignment.Horizontal
```

### Start

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val Start: Alignment.Horizontal
```

### Top

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val Top: Alignment.Vertical
```

### TopCenter

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val TopCenter: Alignment
```

### TopEnd

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val TopEnd: Alignment
```

### TopStart

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val TopStart: Alignment
```

## Public functions

### align

Cmn Added in [1.10.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.10.0)

```
fun align(size: IntSize, space: IntSize, layoutDirection: LayoutDirection): IntOffset
```

Calculates the position of a box of size `https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment#align(androidx.compose.ui.unit.IntSize,androidx.compose.ui.unit.IntSize,androidx.compose.ui.unit.LayoutDirection)` relative to the top left corner of an area of size `https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment#align(androidx.compose.ui.unit.IntSize,androidx.compose.ui.unit.IntSize,androidx.compose.ui.unit.LayoutDirection)`. The returned offset can be negative or larger than `space - size`, meaning that the box will be positioned partially or completely outside the area.