# TextDecoration

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

  ```
  class TextDecoration
  ```

*** ** * ** ***

Defines text decorations such as underline or line-through.

## Summary

| ### Public companion functions |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDecoration` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDecoration#combine(kotlin.collections.List)(decorations: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDecoration>)` Combines multiple `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDecoration`s into a single decoration. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDecoration` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDecoration#valueOf(kotlin.Int)(mask: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Creates a `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDecoration` from a `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDecoration.Companion#valueOf(kotlin.Int)`. | Cmn |

| ### Public companion properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDecoration` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDecoration#LineThrough()` Draws a horizontal line over the text. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDecoration` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDecoration#None()` | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDecoration` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDecoration#Underline()` Draws a horizontal line below the text. | Cmn |

| ### Public functions |
|---|---|---|
| `operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDecoration#contains(androidx.compose.ui.text.style.TextDecoration)(other: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDecoration)` Checks if this decoration contains `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDecoration#contains(androidx.compose.ui.text.style.TextDecoration)`. | 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/TextDecoration#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/TextDecoration#hashCode()()` | Cmn |
| `operator https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDecoration` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDecoration#plus(androidx.compose.ui.text.style.TextDecoration)(decoration: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDecoration)` Combines this decoration with `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDecoration#plus(androidx.compose.ui.text.style.TextDecoration)`. | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDecoration#toString()()` | Cmn |

| ### Public properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDecoration#mask()` bitmask representing the combined decorations. | Cmn |

## Public companion functions

### combine

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

```
fun combine(decorations: List<TextDecoration>): TextDecoration
```

Combines multiple `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDecoration`s into a single decoration.

```kotlin
import androidx.compose.material3.Text
import androidx.compose.ui.text.style.TextDecoration

Text(text = "Demo Text", textDecoration = TextDecoration.Underline + TextDecoration.LineThrough)
```

| Parameters |
|---|---|
| `decorations: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDecoration>` | decorations to combine. |

### valueOf

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

```
fun valueOf(mask: Int): TextDecoration
```

Creates a `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDecoration` from a `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDecoration.Companion#valueOf(kotlin.Int)`.

Attempts to avoid allocations for well-known decorations.

| Parameters |
|---|---|
| `mask: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | bitmask of the decoration. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDecoration.Companion#valueOf(kotlin.Int)` is invalid. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDecoration#mask()` |   |

## Public companion properties

### LineThrough

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

```
val LineThrough: TextDecoration
```

Draws a horizontal line over the text.

```kotlin
import androidx.compose.material3.Text
import androidx.compose.ui.text.style.TextDecoration

Text(text = "Demo Text", textDecoration = TextDecoration.LineThrough)
```

### None

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

```
val None: TextDecoration
```

### Underline

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

```
val Underline: TextDecoration
```

Draws a horizontal line below the text.

```kotlin
import androidx.compose.material3.Text
import androidx.compose.ui.text.style.TextDecoration

Text(text = "Demo Text", textDecoration = TextDecoration.Underline)
```

## Public functions

### contains

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

```
operator fun contains(other: TextDecoration): Boolean
```

Checks if this decoration contains `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDecoration#contains(androidx.compose.ui.text.style.TextDecoration)`.

| Parameters |
|---|---|
| `other: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDecoration` | decoration to check. |

### equals

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

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

### hashCode

Cmn

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

### plus

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

```
operator fun plus(decoration: TextDecoration): TextDecoration
```

Combines this decoration with `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDecoration#plus(androidx.compose.ui.text.style.TextDecoration)`.

```kotlin
import androidx.compose.material3.Text
import androidx.compose.ui.text.style.TextDecoration

Text(text = "Demo Text", textDecoration = TextDecoration.Underline + TextDecoration.LineThrough)
```

### toString

Cmn

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

## Public properties

### mask

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

```
val mask: Int
```

bitmask representing the combined decorations.