# LineHeightStyle

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

  ```
  class LineHeightStyle
  ```

*** ** * ** ***

Configures line height behavior, including alignment and trimming of extra space.

Applies only when a line height is defined on the text.

## Summary

| ### Nested types |
|---|
| `value class https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/LineHeightStyle.Alignment` Aligns the line within the space provided by the line height. |
| `value class https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/LineHeightStyle.Mode` Determines how line height is calculated across lines in a paragraph. |
| `value class https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/LineHeightStyle.Trim` Controls trimming of extra space from the first line top and last line bottom. |

| ### Public companion properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/LineHeightStyle` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/LineHeightStyle#Default()` The default configuration for `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/LineHeightStyle`: | Cmn |

| ### Public constructors |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/LineHeightStyle#LineHeightStyle(androidx.compose.ui.text.style.LineHeightStyle.Alignment,androidx.compose.ui.text.style.LineHeightStyle.Trim)( alignment: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/LineHeightStyle.Alignment, trim: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/LineHeightStyle.Trim )` | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/LineHeightStyle#LineHeightStyle(androidx.compose.ui.text.style.LineHeightStyle.Alignment,androidx.compose.ui.text.style.LineHeightStyle.Trim,androidx.compose.ui.text.style.LineHeightStyle.Mode)( alignment: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/LineHeightStyle.Alignment, trim: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/LineHeightStyle.Trim, mode: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/LineHeightStyle.Mode )` | Cmn |

| ### Public functions |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/LineHeightStyle` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/LineHeightStyle#copy(androidx.compose.ui.text.style.LineHeightStyle.Alignment,androidx.compose.ui.text.style.LineHeightStyle.Trim,androidx.compose.ui.text.style.LineHeightStyle.Mode)( alignment: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/LineHeightStyle.Alignment, trim: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/LineHeightStyle.Trim, mode: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/LineHeightStyle.Mode )` Returns a copy of this `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/LineHeightStyle`, optionally overriding some of the values. | Cmn |
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/LineHeightStyle#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/LineHeightStyle#hashCode()()` | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/LineHeightStyle#toString()()` | Cmn |

| ### Public 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()` alignment of the line within the allocated line height. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/LineHeightStyle.Mode` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/LineHeightStyle#mode()` behavior when the specified line height is smaller than the system default (see `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/LineHeightStyle.Mode`). | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/LineHeightStyle.Trim` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/LineHeightStyle#trim()` trimming behavior for the top of the first line and bottom of the last line. | Cmn |

## Public companion properties

### Default

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

```
val Default: LineHeightStyle
```

The default configuration for `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()`

- trim = `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/LineHeightStyle.Trim#Both()`

- mode = `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/LineHeightStyle.Mode#Fixed()`

## Public constructors

### LineHeightStyle

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

```
LineHeightStyle(
    alignment: LineHeightStyle.Alignment,
    trim: LineHeightStyle.Trim
)
```

### LineHeightStyle

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

```
LineHeightStyle(
    alignment: LineHeightStyle.Alignment,
    trim: LineHeightStyle.Trim,
    mode: LineHeightStyle.Mode
)
```

| Parameters |
|---|---|
| `alignment: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/LineHeightStyle.Alignment` | alignment of the line within the allocated line height. |
| `trim: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/LineHeightStyle.Trim` | trimming behavior for the top of the first line and bottom of the last line. Requires PlatformParagraphStyle.includeFontPadding to be false. |
| `mode: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/LineHeightStyle.Mode` | behavior when the specified line height is smaller than the system default (see `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/LineHeightStyle.Mode`). |

## Public functions

### copy

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

```
fun copy(
    alignment: LineHeightStyle.Alignment = this.alignment,
    trim: LineHeightStyle.Trim = this.trim,
    mode: LineHeightStyle.Mode = this.mode
): LineHeightStyle
```

Returns a copy of this `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/LineHeightStyle`, optionally overriding some of the values.

### equals

Cmn

```
open operator fun equals(other: Any?): Boolean
```

### hashCode

Cmn

```
open fun hashCode(): Int
```

### toString

Cmn

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

## Public properties

### alignment

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

```
val alignment: LineHeightStyle.Alignment
```

alignment of the line within the allocated line height.

### mode

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

```
val mode: LineHeightStyle.Mode
```

behavior when the specified line height is smaller than the system default (see `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/LineHeightStyle.Mode`).

### trim

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

```
val trim: LineHeightStyle.Trim
```

trimming behavior for the top of the first line and bottom of the last line. Requires PlatformParagraphStyle.includeFontPadding to be false.