# Placeholder

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

  ```
  class Placeholder
  ```

*** ** * ** ***

A placeholder is a rectangle box inserted into text, which tells the text processor to leave an empty space. It is typically used to insert inline image, custom emoji, etc into the text paragraph.

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit#Unspecified()` is passed to `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Placeholder#width()` or `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Placeholder#height()`. |

## Summary

| ### Public constructors |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Placeholder#Placeholder(androidx.compose.ui.unit.TextUnit,androidx.compose.ui.unit.TextUnit,androidx.compose.ui.text.PlaceholderVerticalAlign)( width: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit, height: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit, placeholderVerticalAlign: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/PlaceholderVerticalAlign )` | Cmn |

| ### Public functions |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Placeholder` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Placeholder#copy(androidx.compose.ui.unit.TextUnit,androidx.compose.ui.unit.TextUnit,androidx.compose.ui.text.PlaceholderVerticalAlign)( width: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit, height: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit, placeholderVerticalAlign: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/PlaceholderVerticalAlign )` | Cmn |
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Placeholder#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/Placeholder#hashCode()()` | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Placeholder#toString()()` | Cmn |

| ### Public properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Placeholder#height()` the height of the placeholder, it must be specified in sp or em. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/PlaceholderVerticalAlign` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Placeholder#placeholderVerticalAlign()` the vertical alignment of the placeholder within the text line. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Placeholder#width()` the width of the placeholder, it must be specified in sp or em. | Cmn |

## Public constructors

### Placeholder

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

```
Placeholder(
    width: TextUnit,
    height: TextUnit,
    placeholderVerticalAlign: PlaceholderVerticalAlign
)
```

| Parameters |
|---|---|
| `width: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit` | the width of the placeholder, it must be specified in sp or em. `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit#Unspecified()` is not allowed. |
| `height: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit` | the height of the placeholder, it must be specified in sp or em. `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit#Unspecified()` is not allowed. |
| `placeholderVerticalAlign: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/PlaceholderVerticalAlign` | the vertical alignment of the placeholder within the text line. Check `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/PlaceholderVerticalAlign` for more information. |

## Public functions

### copy

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

```
fun copy(
    width: TextUnit = this.width,
    height: TextUnit = this.height,
    placeholderVerticalAlign: PlaceholderVerticalAlign = this.placeholderVerticalAlign
): Placeholder
```

### 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
```

### toString

Cmn

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

## Public properties

### height

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

```
val height: TextUnit
```

the height of the placeholder, it must be specified in sp or em. `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit#Unspecified()` is not allowed.

### placeholderVerticalAlign

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

```
val placeholderVerticalAlign: PlaceholderVerticalAlign
```

the vertical alignment of the placeholder within the text line. Check `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/PlaceholderVerticalAlign` for more information.

### width

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

```
val width: TextUnit
```

the width of the placeholder, it must be specified in sp or em. `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit#Unspecified()` is not allowed.