# LineHeightStyle.Alignment

Artifact: [androidx.compose.ui:ui-text](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/text/style/LineHeightStyle.kt+class:androidx.compose.ui.text.style.LineHeightStyle.Alignment) Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.2.0) Common/AllAndroid/JVM
- Cmn

  ```
  value class LineHeightStyle.Alignment
  ```

*** ** * ** ***

Aligns the line within the space provided by the line height.

## Summary

| ### Public companion properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/LineHeightStyle.Alignment` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/LineHeightStyle.Alignment#Bottom()` Align the line to the bottom of the space reserved for that line. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/LineHeightStyle.Alignment` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/LineHeightStyle.Alignment#Center()` Align the line to the center of the space reserved for the line. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/LineHeightStyle.Alignment` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/LineHeightStyle.Alignment#Proportional()` Align the line proportional to the ascent and descent values of the line. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/LineHeightStyle.Alignment` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/LineHeightStyle.Alignment#Top()` Align the line to the top of the space reserved for that line. | Cmn |

| ### Public constructors |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/LineHeightStyle.Alignment#Alignment(kotlin.Float)(topRatio: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` | Cmn |

| ### Public functions |
|---|---|---|
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/LineHeightStyle.Alignment#toString()()` | Cmn |

| ### Public properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/LineHeightStyle.Alignment#topRatio()` the alignment ratio of the text. | Cmn |

## Public companion properties

### Bottom

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

```
val Bottom: LineHeightStyle.Alignment
```

Align the line to the bottom of the space reserved for that line. This means that all extra space as a result of line height is applied to the top of the line. When the provided line height value is smaller than the actual line height, the line will still be aligned to the bottom, therefore the required difference will be subtracted from the top of the line.

For example, when line height is 3.em, the lines are aligned to the bottom of 3.em height:

```
+---+
|        |
|        |
| Line1  |
|---|
|        |
|        |
| Line2  |
+---+
```

### Center

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

```
val Center: LineHeightStyle.Alignment
```

Align the line to the center of the space reserved for the line. This configuration distributes additional space evenly between top and bottom of the line.

For example, when line height is 3.em, the lines are aligned to the center of 3.em height:

```
+---+
|        |
| Line1  |
|        |
|---|
|        |
| Line2  |
|        |
+---+
```

### Proportional

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

```
val Proportional: LineHeightStyle.Alignment
```

Align the line proportional to the ascent and descent values of the line. For example if ascent is 8 units of length, and descent is 2 units; an additional space of 10 units will be distributed as 8 units to top, and 2 units to the bottom of the line. This is the default behavior.

### Top

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

```
val Top: LineHeightStyle.Alignment
```

Align the line to the top of the space reserved for that line. This means that all extra space as a result of line height is applied to the bottom of the line. When the provided line height value is smaller than the actual line height, the line will still be aligned to the top, therefore the required difference will be subtracted from the bottom of the line.

For example, when line height is 3.em, the lines are aligned to the top of 3.em height:

```
+---+
| Line1  |
|        |
|        |
|---|
| Line2  |
|        |
|        |
+---+
```

## Public constructors

### Alignment

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

```
Alignment(topRatio: Float)
```

## Public functions

### toString

Cmn

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

## Public properties

### topRatio

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

```
val topRatio: Float
```

the alignment ratio of the text. 0f aligns to top, 0.5f to center, 1f to bottom, and -1f aligns proportionally based on font metrics (ascent/descent ratio).