<div class='type'>Function</div>


<a id='references'></a>


<h2 id="appendinlinecontent-id-alternatetext">appendInlineContent</h2>

<div class='sourceset sourceset-common'>Common</div>


```kotlin
fun AnnotatedString.Builder.appendInlineContent(
    id: String,
    alternateText: String = REPLACEMENT_CHAR,
)
```


Used to insert composables into the text layout. This method can be used together with the
inlineContent parameter of `BasicText`. It will append the `alternateText` to this
`AnnotatedString` and also mark this range of text to be replaced by a composable. `BasicText`
will try to find an `InlineTextContent` in the map defined by inlineContent whose key equals to
`id`, and it will use the `InlineTextContent.children` to replace this range of text.

#### Parameters

| | |
| --- | --- |
| id | The id used to look up the `InlineTextContent`, it is referred by the inlineContent parameter of `BasicText` to replace the `alternateText` to the corresponding composable. |
| alternateText | The text to be replaced by the inline content. It's displayed when the inlineContent parameter of `BasicText` doesn't contain `id`. Accessibility features will also use this text to describe the inline content. |