Rich text preformatted element
Fields
| Field | Type | Description | Required? |
|---|---|---|---|
type | String | The type of the sub-element; in this case, rich_text_preformatted. | Required |
elements | Object [] | An array of text or link elements. | Required |
border | Number | Turn the border on or off. | Optional |
language | String | The language of the code block, used for syntax highlighting (e.g., "python", "javascript", "json"). | Optional |
Example

- JSON
- Python Slack SDK
- Node Slack SDK
- Java Slack SDK
{
"blocks": [
{
"type": "rich_text",
"elements": [
{
"type": "rich_text_preformatted",
"elements": [
{
"type": "text",
"text": "{\n \"object\": {\n \"description\": \"this is an example of a json object\"\n }\n}"
}
],
"border": 0
}
]
}
]
}
block-kit/src/blocks/rich_text.py
loading...
block-kit/src/blocks/rich_text.js
loading...
block-kit/src/main/java/blocks/RichText.java
loading...