Skip to main content

expanded_rich_text type

This reference documents the Slack types at the platform level. Their availability and structure may differ in each SDK

Type: slack#/types/expanded_rich_text

The expanded_rich_text type is a superset of the rich_text type, and is explicitly for use with canvases. It accepts all elements that rich_text provides and behaves in the same way as rich_text, except that it also accepts the following additional sub-elements:

PropertyTypeDescription
defaultThe type that is being described.An optional parameter default value.
descriptionstringAn optional parameter description.
examplesAn array of the type being described.An optional list of examples.
hintstringAn optional parameter hint.
titlestringAn optional parameter title.
typestringString that defines the parameter type.
rich_text_headerobjectThe text for the header, in the form of a plain_text text object.
rich_text_dividerobjectCreates a divider to place between text.
rich_text_listobjectThis is an expanded version of the rich_text_list element used in rich_text blocks. It behaves the same, except that it accepts two new style fields: checked and unchecked. This allows for the creation of checklists.

Declare an expanded_rich_text type:

// ...
"canvas_content": {
"title": "Canvas Content",
"type": "slack#/types/expanded_rich_text"
}
// ...
Expanded rich text example

Here is an example payload that shows the expanded_rich_text type and all of its sub-elements:

[
{
"type": "expanded_rich_text",
"elements": [
{
"type": "rich_text_header",
"elements": [
{
"type": "text",
"text": "Hello world"
}
],
"level": 1
},
{
"type": "rich_text_list",
"style": "unchecked",
"indent": 0,
"elements": [
{
"type": "rich_text_section",
"elements": [
{
"type": "text",
"text": "one"
}
]
}
],
"border": 0
},
{
"type": "rich_text_list",
"style": "checked",
"indent": 1,
"elements": [
{
"type": "rich_text_section",
"elements": [
{
"type": "text",
"text": "two"
}
]
}
],
"border": 0
},
{
"type": "rich_text_divider"
}
]
}
]