Skip to main content

Rich text preformatted element

Fields

FieldTypeDescriptionRequired?
typeStringThe type of the sub-element; in this case, rich_text_preformatted.Required
elementsObject []An array of text or link elements.Required
borderNumberTurn the border on or off.Optional
languageStringThe language of the code block, used for syntax highlighting (e.g., "python", "javascript", "json").Optional

Example

An example of a rich_text_preformatted block

{
"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
}
]
}
]
}

View in Block Kit Builder