---
schema_version: "1"
id: 514056c38b28547b7477e8a336e808faafe45d5d7fc570f27d2f8ba1190943ea
title: Rich Text Display
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/genai/agentforce-mobile-sdk/references/android/rich-text-display-android.md
canonical_url: https://developer.salesforce.com/docs/ai/agentforce-mobile-sdk/references/agentforce-mobile-sdk/rich-text-display-android.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 46855d79b3321a407ad344b7c8a5d8deea0eb256c09d2b015f7101816ba562df
products:
  - Agentforce Mobile SDK
  - Agentforce and Einstein Generative AI
---
# Rich Text Display

Android Compose components for rich text rendering in Agentforce conversations.

## SalesforceRichText

`@Composable fun SalesforceRichText`

Shows a static label with the styled text from the provided HTML string.

### Signature

```kotlin
@Composable
fun SalesforceRichText(
    modifier: Modifier = Modifier,
    text: String,
    customMovementMethod: MovementMethod = LinkMovementMethod.getInstance()
)
```

### Parameters

| Parameter            | Type           | Description                             |
| -------------------- | -------------- | --------------------------------------- |
| modifier             | Modifier       | Modifier to be applied to the component |
| text                 | String         | HTML string to display                  |
| customMovementMethod | MovementMethod | Movement method for text interaction    |

## AgentforceRichText

`@Composable fun AgentforceRichText`

Displays rich text content. Intended to be displayed in the content area of the chat response.

### Signatures

```kotlin
@Composable
fun AgentforceRichText(
    view: AgentforceComponent
)

@Composable
fun AgentforceRichText(
    text: String,
    isContentSafe: Boolean? = true,
    padding: Dp = dimensionResource(id = R.dimen.slds_spacing_small),
    locator: String = "copilot_richtext_content",
    isPartialMessage: Boolean = false
)
```

### Parameters

| Parameter        | Type                | Description                                                          |
| ---------------- | ------------------- | -------------------------------------------------------------------- |
| view             | AgentforceComponent | Component view to display                                            |
| text             | String              | Text content to display                                              |
| isContentSafe    | Boolean?            | Whether the content is safe to display (default: true)               |
| padding          | Dp                  | Padding around the content                                           |
| locator          | String              | Locator identifier for testing (default: "copilot_richtext_content") |
| isPartialMessage | Boolean             | Whether this is a partial message (default: false)                   |

## AgentforceMarkdownRichText

`@Composable fun AgentforceMarkdownRichText`

Markdown UI for view provider mapped to ES type.

### Signatures

```kotlin
@Composable
fun AgentforceMarkdownRichText(
    view: AgentforceComponent
)

@Composable
fun AgentforceMarkdownRichText(
    text: String,
    isContentSafe: Boolean? = true,
    padding: Dp = dimensionResource(id = R.dimen.slds_spacing_small),
    maxLines: Int = Int.MAX_VALUE,
    locator: String = "copilot_markdown_content",
    isPartialMessage: Boolean = false
)
```

### Parameters

| Parameter        | Type                | Description                                                          |
| ---------------- | ------------------- | -------------------------------------------------------------------- |
| view             | AgentforceComponent | Component view to display                                            |
| text             | String              | Markdown text content to display                                     |
| isContentSafe    | Boolean?            | Whether the content is safe to display (default: true)               |
| padding          | Dp                  | Padding around the content                                           |
| maxLines         | Int                 | Maximum number of lines to display (default: Int.MAX_VALUE)          |
| locator          | String              | Locator identifier for testing (default: "copilot_markdown_content") |
| isPartialMessage | Boolean             | Whether this is a partial message (default: false)                   |

## Related Documentation

- [AgentforceThemeManager](https://developer.salesforce.com/docs/ai/agentforce-mobile-sdk/references/agentforce-mobile-sdk/agentforce-theme-manager-android.md)
- [AgentforceColors](https://developer.salesforce.com/docs/ai/agentforce-mobile-sdk/references/agentforce-mobile-sdk/agentforce-colors-android.md)
- [AgentforceTypography](https://developer.salesforce.com/docs/ai/agentforce-mobile-sdk/references/agentforce-mobile-sdk/agentforce-typography-android.md)
