# Text element

Displays text, optionally styled.

| | |
|---|---|
| **Available in** | Messages, Modals, Home tab |
| **Used in** | [Rich text section element](https://workstation.repzo.com/docs/developers/block-kit/rich-text/rich-text-section-element), [Rich text list element](https://workstation.repzo.com/docs/developers/block-kit/rich-text/rich-text-list-element), [Rich text quote element](https://workstation.repzo.com/docs/developers/block-kit/rich-text/rich-text-quote-element), [Rich text preformatted element](https://workstation.repzo.com/docs/developers/block-kit/rich-text/rich-text-preformatted-element) |

## Fields

| Field | Type | Description | Required? |
|---|---|---|---|
| `type` | String | The type of object; in this case, `text`. | Required |
| `text` | String | The text shown to the reader. `\n` starts a new line. | Required |
| `style` | Object | An object of optional boolean properties that dictate style: `bold`, `code`, `italic`, `strike`, `highlight`, `client_highlight`, `underline` and `unlink`. | Optional |

> **How Repzo Chat differs from Slack**
>
> - `style` supports `bold`, `italic`, `strike`, `underline` and `code`; `highlight`, `client_highlight` and `unlink` are ignored.

## Examples

### Styled text

```json
{
  "blocks": [
    {
      "type": "rich_text",
      "elements": [
        {
          "type": "rich_text_section",
          "elements": [
            {
              "type": "text",
              "text": "Status: "
            },
            {
              "type": "text",
              "text": "Approved",
              "style": {
                "bold": true
              }
            },
            {
              "type": "text",
              "text": " · Reference "
            },
            {
              "type": "text",
              "text": "PO-1187",
              "style": {
                "code": true
              }
            },
            {
              "type": "text",
              "text": " · "
            },
            {
              "type": "text",
              "text": "Draft",
              "style": {
                "strike": true
              }
            }
          ]
        }
      ]
    }
  ]
}
```

## Related

- [Rich text elements](https://workstation.repzo.com/docs/developers/block-kit/rich-text)
- [Block Kit overview](https://workstation.repzo.com/docs/developers/block-kit)
