Rich Text
Inline and layout factories for Slack rich-text blocks.
Build inline elements first, combine them in a section, list, quote, or code
block, then pass those layout objects to richTextBlock.
richText()
richText(
text,style?,settings?):SlackObject<"text">
Creates a styled rich-text text run.
Parameters
| Parameter | Type | Description |
|---|---|---|
text | string | Text content. |
style? | RichTextStyle | Optional inline formatting. |
settings? | FactorySettings | Per-call validation settings. |
Returns
SlackObject<"text">
A validated Slack rich-text text element.
richTextChannel()
richTextChannel(
channelId,style?,settings?):SlackObject<"channel">
Creates a rich-text channel mention.
Parameters
| Parameter | Type | Description |
|---|---|---|
channelId | string | Slack channel identifier. |
style? | RichTextStyle | Optional inline formatting. |
settings? | FactorySettings | Per-call validation settings. |
Returns
SlackObject<"channel">
A validated Slack rich-text channel element.
richTextCodeBlock()
richTextCodeBlock(
elements,options?,settings?):SlackObject<"rich_text_preformatted">
Creates a preformatted rich-text code block.
Input fields
Optional border thickness.
| Input field | Type | Description |
|---|---|---|
border? | number | Optional border thickness. |
Settings
| Setting | Type | Description |
|---|---|---|
elements | JsonObject[] | Inline rich-text elements displayed as code. |
settings | FactorySettings | Per-call validation settings. |
Returns
SlackObject<"rich_text_preformatted">
A validated Slack rich_text_preformatted object.
richTextEmoji()
richTextEmoji(
name,settings?):SlackObject<"emoji">
Creates a rich-text emoji.
Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | Emoji name without surrounding colons. |
settings | FactorySettings | Per-call validation settings. |
Returns
SlackObject<"emoji">
A validated Slack rich-text emoji element.
richTextLink()
richTextLink(
input,settings?):SlackObject<"link">
Creates a rich-text link.
Input fields
Destination URL, optional label, safety flag, and formatting.
| Input field | Type | Description |
|---|---|---|
style? | RichTextStyle | Optional inline formatting. |
text? | string | Optional visible label. Slack displays the URL when omitted. |
unsafe? | boolean | Mark a URL as unsafe when mirroring a Slack-provided payload. |
url | string | Destination URL. |
Settings
| Setting | Type | Description |
|---|---|---|
settings | FactorySettings | Per-call validation settings. |
Returns
SlackObject<"link">
A validated Slack rich-text link element.
richTextList()
richTextList(
input,settings?):SlackObject<"rich_text_list">
Creates an ordered or bulleted rich-text list.
Input fields
List items, marker style, and optional list layout.
| Input field | Type | Description |
|---|---|---|
border? | number | Optional border thickness. |
elements | JsonObject[] | Rich-text section objects used as list items. |
indent? | number | Nesting depth. |
offset? | number | Starting number for an ordered list. |
style | "bullet" | "ordered" | List marker style. |
Settings
| Setting | Type | Description |
|---|---|---|
settings | FactorySettings | Per-call validation settings. |
Returns
SlackObject<"rich_text_list">
A validated Slack rich_text_list object.
Throws
MissingRequiredError when style is not provided.
richTextQuote()
richTextQuote(
elements,options?,settings?):SlackObject<"rich_text_quote">
Creates a rich-text block quote.
Input fields
Optional border thickness.
| Input field | Type | Description |
|---|---|---|
border? | number | Optional border thickness. |
Settings
| Setting | Type | Description |
|---|---|---|
elements | JsonObject[] | Inline rich-text elements displayed in the quote. |
settings | FactorySettings | Per-call validation settings. |
Returns
SlackObject<"rich_text_quote">
A validated Slack rich_text_quote object.
richTextSection()
richTextSection(
elements,settings?):SlackObject<"rich_text_section">
Creates a paragraph-like rich-text section.
Parameters
| Parameter | Type | Description |
|---|---|---|
elements | JsonObject[] | Inline rich-text elements in display order. |
settings | FactorySettings | Per-call validation settings. |
Returns
SlackObject<"rich_text_section">
A validated Slack rich_text_section object.
RichTextStyle
Inline formatting supported by rich-text text, links, users, and channels.
Properties
richTextUser()
richTextUser(
userId,style?,settings?):SlackObject<"user">
Creates a rich-text user mention.
Parameters
| Parameter | Type | Description |
|---|---|---|
userId | string | Slack user identifier. |
style? | RichTextStyle | Optional inline formatting. |
settings? | FactorySettings | Per-call validation settings. |
Returns
SlackObject<"user">
A validated Slack rich-text user element.
richTextUserGroup()
richTextUserGroup(
usergroupId,style?,settings?):SlackObject<"usergroup">
Creates a rich-text user-group mention.
Parameters
| Parameter | Type | Description |
|---|---|---|
usergroupId | string | Slack user-group identifier. |
style? | RichTextStyle | Optional inline formatting. |
settings? | FactorySettings | Per-call validation settings. |
Returns
SlackObject<"usergroup">
A validated Slack rich-text usergroup element.