# Rich Text Component

## Overview

The Rich Text component is used to compose and display formatted text, and can also be made clickable using blocks.

Rich Text works alongside other user interface components like buttons, images, and text inputs to create a cohesive and intuitive user experience.&#x20;

<figure><img src="https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LAn5scXl2uqUJUOqkJo-84897653%2Fuploads%2FtrQoBF9UPl3aL4FMbKBM%2FScreen%20Shot%202024-04-08%20at%203.32.50%20PM.png?alt=media&#x26;token=f6f311f4-0e8d-4af4-9506-08c115eda802" alt=""><figcaption></figcaption></figure>

## Properties

You can customize your Rich Text component using the following properties:&#x20;

### Rich Text

<table><thead><tr><th width="216.69525053355846">Property</th><th width="183.58335031860162">Value</th><th>Description</th></tr></thead><tbody><tr><td>Text</td><td>Text</td><td>Text that appears on the Rich Text Component</td></tr><tr><td>Font</td><td>Select from menu</td><td>Font used to display component's text</td></tr><tr><td>Font Size</td><td>Number</td><td>Size of the text</td></tr><tr><td>Font Weight</td><td>True/False</td><td>Make the text bold</td></tr><tr><td>Color</td><td>Color</td><td>Color of the text that appears on the component</td></tr><tr><td>Highlight Color</td><td>Color</td><td>The color in which to highlight the text</td></tr><tr><td>Strikethrough</td><td>True/False</td><td>Draw a line through the select text</td></tr><tr><td>Underline</td><td>True/False</td><td>Underline the selected text</td></tr><tr><td>Italic</td><td>True/False</td><td>Make the selected text italicized</td></tr><tr><td>Text Align</td><td>Select from menu</td><td>Set alignment of the text relative to the outline</td></tr><tr><td>Line Spacing</td><td>Number</td><td>Maximum amount of lines of text that will display</td></tr><tr><td>Visible</td><td>True/False</td><td>Display or hide the component</td></tr></tbody></table>

{% hint style="info" %}
Using Custom Fonts may only be available for Creators on certain Thunkable plans. Please refer to our pricing page for more information: [Thunkable pricing](https://thunkable.com/pricing).
{% endhint %}

### Layout

<table><thead><tr><th width="160.57888762769582">Property</th><th width="173">Value</th><th>Description</th></tr></thead><tbody><tr><td>X</td><td>coordinate value</td><td>Position of the upper left corner of the Rich Text component on the X-axis, where the left side of the screen is X=0.</td></tr><tr><td>Y</td><td>coordinate value</td><td>Position of the upper left corner of the Rich Text component on the Y-axis, where the top of the screen is Y=0.</td></tr><tr><td>Height</td><td>number in pixels</td><td>The Rich Text component's height is defined by a custom number of pixels.</td></tr><tr><td>Width</td><td>number in pixels</td><td>The Rich Text component's width is defined by a custom number of pixels.</td></tr><tr><td>Resize Mode</td><td>Stretch</td><td>Stretches the Rich Text component to fit the dimensions of the device's screen.</td></tr><tr><td>Resize Mode</td><td>Float in Place</td><td>Renders the Rich Text component in the same aspect ratio as the design, regardless of the device size.</td></tr></tbody></table>

### Style

<table><thead><tr><th width="197.33333333333331">Property</th><th width="252">Value</th><th>Description</th></tr></thead><tbody><tr><td>Visible</td><td>visible</td><td>Users can see the Rich Text.</td></tr><tr><td>Visible</td><td>invisible</td><td>Users cannot see the Rich Text.</td></tr><tr><td>Background Color</td><td>color</td><td>The background color of the Rich Text.</td></tr><tr><td>Border: Style</td><td>solid</td><td>The Rich Text component's border is a solid line.</td></tr><tr><td>Border: Style</td><td>dotted</td><td>The Rich Text component's border is a dotted line.</td></tr><tr><td>Border: Style</td><td>dashed</td><td>The Rich Text component's border is a dashed line.</td></tr><tr><td>Border: Color</td><td>color</td><td>The Rich Text component's border is the color selected. </td></tr><tr><td>Border: Width</td><td>number in pixels</td><td>The width of the Rich Text component's border is defined by a custom number of pixels.</td></tr><tr><td>Border: Radius</td><td>number in pixels</td><td>The radius of the Rich Text component's border’s corners is defined by a custom number of pixels.</td></tr><tr><td>Shadow: Color</td><td>color</td><td>The Rich Text component's shadow is the color selected. </td></tr><tr><td>Shadow: Opacity</td><td>number between 0 and 100</td><td>The opacity of the Rich Text component's shadow. </td></tr><tr><td>Shadow: Radius</td><td>number in pixels</td><td>The radius of the Rich Text component's shadow’s corners is defined by a custom number of pixels.</td></tr><tr><td>Shadow: Offset</td><td>number in pixels</td><td>How far the Rich Text component's  shadow should be offset, in height and width, is defined by a custom number of pixels.</td></tr></tbody></table>

## Rich Text Blocks

To access the blocks specific to the Rich Text component:

1. On the Design tab, add a **Rich Text** component to a screen.
2. Navigate to the **Blocks** tab.
3. In the component tree on the left, click the name of the Rich Text component.
4. A drawer of Rich-Text-specific blocks opens.

| Block Image                                                                                                                                                                                                                                                                    | Description                                                                                                                                                                                                              |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| <p></p><p><img src="https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LAn5scXl2uqUJUOqkJo-84897653%2Fuploads%2F2sBpdiYANB2kC5fzFG8j%2F1.png?alt=media&#x26;token=5f8b098f-1ded-4f6a-b442-5646f882457d" alt="" data-size="original"></p>  | This event will fire when the user clicks on the Rich Text.                                                                                                                                                              |
| <p></p><p><img src="https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LAn5scXl2uqUJUOqkJo-84897653%2Fuploads%2F8QjcsnMjZFJDyIE9YMLV%2F2.png?alt=media&#x26;token=29f09c94-75de-4a62-9c6d-3299c1aee1ee" alt="" data-size="original"></p>  | Removes all text from the component.                                                                                                                                                                                     |
| <p></p><p><img src="https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LAn5scXl2uqUJUOqkJo-84897653%2Fuploads%2FOVrVmZCeb6bECVaWlWrH%2F3.png?alt=media&#x26;token=5c36adac-1425-409c-b27d-42acb54bca26" alt="" data-size="original"></p>  | Reset all text formatting (including paragraph modifiers) to the default styling (i.e., the styling that a brand new Rich Text component has before it is modified).                                                     |
| <p></p><p><img src="https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LAn5scXl2uqUJUOqkJo-84897653%2Fuploads%2F2tz5nDFfNRmsihVWbnAs%2F4.png?alt=media&#x26;token=7bbf9485-1ed5-49b9-8b2d-dbee16197d3d" alt="" data-size="original"></p>  | Replace any text with the provided string. This will set it to the “default component styling” (no modifiers).                                                                                                           |
| <p></p><p><img src="https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LAn5scXl2uqUJUOqkJo-84897653%2Fuploads%2FzXOu8gb3A5LiYMf6UTZ8%2F5.png?alt=media&#x26;token=a9697da4-2d11-4b64-bbac-d89e7ed1346d" alt="" data-size="original"></p>  | Get the component's text.                                                                                                                                                                                                |
| <p></p><p><img src="https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LAn5scXl2uqUJUOqkJo-84897653%2Fuploads%2FGV39BgL7693eP6V4WVkQ%2F7.png?alt=media&#x26;token=c689702a-52ae-4814-8fca-fd50ef40ee38" alt="" data-size="original"></p>  | Set the background color of the component.                                                                                                                                                                               |
| <p></p><p><img src="https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LAn5scXl2uqUJUOqkJo-84897653%2Fuploads%2FKrH5uqZdNWuUR9IFQhoZ%2F8.png?alt=media&#x26;token=856f9990-83ea-434a-af7a-4bfdc5ed75cb" alt="" data-size="original"></p>  | Get the background color.                                                                                                                                                                                                |
| <p></p><p><img src="https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LAn5scXl2uqUJUOqkJo-84897653%2Fuploads%2Fosb0yCCMWcO7oOjQg2bb%2F9.png?alt=media&#x26;token=884e89b8-75a4-49d8-b21d-d33b0cbd36fa" alt="" data-size="original"></p>  | Set the height of the component.                                                                                                                                                                                         |
| <p></p><p><img src="https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LAn5scXl2uqUJUOqkJo-84897653%2Fuploads%2FwetE8xwavuw4M5ZV3D1C%2F10.png?alt=media&#x26;token=46d3db1e-ac19-41d5-bbc4-26413e6e8119" alt="" data-size="original"></p> | Get the height of the component.                                                                                                                                                                                         |
| <p></p><p><img src="https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LAn5scXl2uqUJUOqkJo-84897653%2Fuploads%2FZnozWzbMfHHOJtUBJ8XJ%2F11.png?alt=media&#x26;token=a54bd2bb-f59d-428d-802d-691daf8c5fec" alt="" data-size="original"></p> | The `Computed Height` block gets the on-screen dimensions of the component, after it has been rendered on-screen. The value returned is an integer, representing the size of the Rich Text component in pixels.          |
| <p></p><p><img src="https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LAn5scXl2uqUJUOqkJo-84897653%2Fuploads%2FPoq0BRH1c8cMUlQS5kNp%2F12.png?alt=media&#x26;token=854f6ea3-1503-4a38-a112-a2727824a2b0" alt="" data-size="original"></p> | Set the width of the component.                                                                                                                                                                                          |
| <p></p><p><img src="https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LAn5scXl2uqUJUOqkJo-84897653%2Fuploads%2FDvEnhjXQGHlHTAnAlEYk%2F13.png?alt=media&#x26;token=7ec49feb-24ec-41d0-80b4-f25b61e44585" alt="" data-size="original"></p> | Get the width of the component.                                                                                                                                                                                          |
| <p></p><p><img src="https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LAn5scXl2uqUJUOqkJo-84897653%2Fuploads%2FjDenKCJ2CJV2PO7jiZw0%2F14.png?alt=media&#x26;token=910f1e19-0b90-48aa-8ac3-eeaad8654112" alt="" data-size="original"></p> | The `Computed Width` block gets the on-screen dimensions of the Rich Text component, after it has been rendered on-screen. The value returned is an integer, representing the size of the Rich Text component in pixels. |
| <p></p><p><img src="https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LAn5scXl2uqUJUOqkJo-84897653%2Fuploads%2F71MgsN2ypk6JoWheIIob%2F15.png?alt=media&#x26;token=33040eb5-4484-457f-ae08-1ae713ad7a47" alt="" data-size="original"></p> | Choose whether to display or hide the component.                                                                                                                                                                         |
| <p></p><p><img src="https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LAn5scXl2uqUJUOqkJo-84897653%2Fuploads%2FMRo0fn7Wm7T4EA1DMkw4%2F16.png?alt=media&#x26;token=ef567631-73fb-4cc6-99f3-2def7dc880fa" alt="" data-size="original"></p> | Get the True or False value for the Visible state.                                                                                                                                                                       |
| <p></p><p><img src="https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LAn5scXl2uqUJUOqkJo-84897653%2Fuploads%2FvFLhyMP3HTBOomOysvPu%2F17.png?alt=media&#x26;token=497c62d5-8671-4418-ad73-1afb661be5c5" alt="" data-size="original"></p> | Set the position of the component on the X-Axis, where the left side of the screen is X=0.                                                                                                                               |
| <p></p><p><img src="https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LAn5scXl2uqUJUOqkJo-84897653%2Fuploads%2FGRuAur19iXiMpQP9eyGm%2F18.png?alt=media&#x26;token=72d528ab-4990-4cae-8d1b-d04201d0499c" alt="" data-size="original"></p> | Get the position of the component on the X-Axis.                                                                                                                                                                         |
| <p></p><p><img src="https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LAn5scXl2uqUJUOqkJo-84897653%2Fuploads%2F0I3lIBLvv5klPn87XUuU%2F19.png?alt=media&#x26;token=759eeced-45f9-4ec5-9679-7f8f5c8eb77e" alt="" data-size="original"></p> | Set the position of the component on the Y-Axis, where the top of the screen is Y=0.                                                                                                                                     |
| <p></p><p><img src="https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LAn5scXl2uqUJUOqkJo-84897653%2Fuploads%2F4FQU04MN6K3uegB8F4zy%2F20.png?alt=media&#x26;token=c96379ed-b01e-4e2a-a240-4a319ed52a70" alt="" data-size="original"></p> | Get the position of the component on the Y-Axis.                                                                                                                                                                         |
| <p></p><p><img src="https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LAn5scXl2uqUJUOqkJo-84897653%2Fuploads%2FSM99LShW0yG38SQGuVrI%2F21.png?alt=media&#x26;token=f776bd4c-ff7c-4bcf-9cf9-610d1a990690" alt="" data-size="original"></p> | Set the font of the component's text.                                                                                                                                                                                    |
| <p></p><p><img src="https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LAn5scXl2uqUJUOqkJo-84897653%2Fuploads%2FH7sM9g0uQQLgS37ysHxd%2F22.png?alt=media&#x26;token=0ede8b22-caed-47e2-bda5-3b553a47f1b2" alt="" data-size="original"></p> | Set the font size of the component's text.                                                                                                                                                                               |
| <p></p><p><img src="https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LAn5scXl2uqUJUOqkJo-84897653%2Fuploads%2FkFDNAJG1muuhO1i6ov9q%2F23.png?alt=media&#x26;token=35567a9d-ed71-40b2-b99b-9f5068a78092" alt="" data-size="original"></p> | Make all the text Bold or Normal.                                                                                                                                                                                        |
| <p></p><p><img src="https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LAn5scXl2uqUJUOqkJo-84897653%2Fuploads%2FD1tdyoMMHXFIdPrkFem1%2F24.png?alt=media&#x26;token=cc724fe1-b735-40c2-b578-e0dd8fd510f9" alt="" data-size="original"></p> | Set all the text to Italic.                                                                                                                                                                                              |
| <p></p><p><img src="https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LAn5scXl2uqUJUOqkJo-84897653%2Fuploads%2Flwz4iAd9A9G5nKoorsUi%2F25.png?alt=media&#x26;token=7cebdb57-c24b-4fad-bffb-74bc7a3aa4b0" alt="" data-size="original"></p> | Underline all the text.                                                                                                                                                                                                  |
| <p></p><p><img src="https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LAn5scXl2uqUJUOqkJo-84897653%2Fuploads%2FAXaCAaMdJXRIzj3KKJyn%2F26.png?alt=media&#x26;token=3ea0d7d4-b8ea-4b06-b0f2-113173d8784c" alt="" data-size="original"></p> | Draw a line through all the text.                                                                                                                                                                                        |
| <p></p><p><img src="https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LAn5scXl2uqUJUOqkJo-84897653%2Fuploads%2Fjw69fIrNuu2BJ2sSXg7I%2F27.png?alt=media&#x26;token=13619244-bf0c-4420-9a37-793baa245be0" alt="" data-size="original"></p> | Highlight all the text in a specific color.                                                                                                                                                                              |
| <p></p><p><img src="https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LAn5scXl2uqUJUOqkJo-84897653%2Fuploads%2FJdvzvZp4WcpbYwPNMVB9%2F28.png?alt=media&#x26;token=bb23402d-b4c5-42e9-98d3-9b9d7bf2b30d" alt="" data-size="original"></p> | Set the line spacing.                                                                                                                                                                                                    |
| <p></p><p><img src="https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LAn5scXl2uqUJUOqkJo-84897653%2Fuploads%2FCJfm0StL4ZnlOf127DrV%2F29.png?alt=media&#x26;token=199022d2-8dfe-4de9-a922-d5f316815f39" alt="" data-size="original"></p> | Set all the text to a specific color.                                                                                                                                                                                    |
| <p></p><p><img src="https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LAn5scXl2uqUJUOqkJo-84897653%2Fuploads%2FF7Nww6VdtydTk1lVw1HN%2F30.png?alt=media&#x26;token=e8c9d8f3-aae5-439e-b044-9cf246356434" alt="" data-size="original"></p> | Set the component's Text Align. Text Align can be any of the following values: Auto, Left, Right, Center, or Justify.                                                                                                    |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.thunkable.com/app-design/ui-components/basic-components/rich-text-component.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
