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:
| Property | Type | Description |
|---|---|---|
default | The type that is being described. | An optional parameter default value. |
description | string | An optional parameter description. |
examples | An array of the type being described. | An optional list of examples. |
hint | string | An optional parameter hint. |
title | string | An optional parameter title. |
type | string | String that defines the parameter type. |
rich_text_header | object | The text for the header, in the form of a plain_text text object. |
rich_text_divider | object | Creates a divider to place between text. |
rich_text_list | object | This 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:
- JSON manifest
- Deno Slack SDK
// ...
"canvas_content": {
"title": "Canvas Content",
"type": "slack#/types/expanded_rich_text"
}
// ...
// ...
{
name: "canvas_content",
title: "Canvas Content",
type: Schema.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"
}
]
}
]