Skip to content
Block Kit for React
Esc
↑↓navigate↵open⌘Jpreview
On this page

Rich text block

Slack's structured formatted-text block, the same format its own composer produces.

rich_text is Slack’s most expressive text block: paragraphs, lists, quotes, and code, each built from styled runs and mentions rather than a markdown string. It’s what Slack’s WYSIWYG message composer outputs, and what a rich_text_input element returns on submit. Reach for it whenever you need structure mrkdwn can’t express, like nested lists or a fenced code block.

Your AppAPP
Ship it, ! Don't forget to update #releases and loop in @engineering.

Fields

PropType
typestring

Always rich_text.

Typestring
elementsRichTextBlockElement[]

The block's top-level content, in order.

TypeRichTextBlockElement[]
block_id?string

A unique identifier for this block. Auto-generated if omitted. Maximum length is 255 characters.

Typestring

Each entry in elements is a block-level element: a paragraph, a list, a quote, or a code block. A block-level element (except a list) in turn holds an array of inline elements: styled text, links, mentions, emoji, and dates.

PropType
rich_text_section?{ type: "rich_text_section"; elements: RichTextElement[] }

A paragraph of inline content, the most common block-level element.

Type{ type: "rich_text_section"; elements: RichTextElement[] }
rich_text_list?{ type: "rich_text_list"; style: "bullet" | "ordered"; indent?: number; border?: number; elements: RichTextSection[] }

A list. indent (0–8) is its nesting level: a list with a deeper indent than the list before it nests under that list's last item; consecutive rich_text_list elements merge into one continuous outline. border: 1 draws the list inside a quote, which the rich_text_quote elements right after it join, as Slack does.

Type{ type: "rich_text_list"; style: "bullet" | "ordered"; indent?: number; border?: number; elements: RichTextSection[] }
rich_text_quote?{ type: "rich_text_quote"; elements: RichTextElement[] }

A blockquote with a colored left bar.

Type{ type: "rich_text_quote"; elements: RichTextElement[] }
rich_text_preformatted?{ type: "rich_text_preformatted"; border?: number; elements: (RichTextText | RichTextLink)[] }

A monospace code block. A language renders it as a syntax-highlighted fenced code block with a copy button; without one it's a plain <pre>, whose links keep its text colour. border: 1 draws it inside a quote, as Slack does.

Type{ type: "rich_text_preformatted"; border?: number; elements: (RichTextText | RichTextLink)[] }

Inline (RichTextElement) types: text (with style.bold / italic / strike / code / underline), link, user, usergroup, channel, broadcast, emoji, date, color, canvas_user_mention, tag, salesforce_data_field, workflow_mention, message_mention, file, canvas, list_record, work_object_mention, attachment_mention and citation.

Examples

Section with styled text

Bold, italic, strikethrough, and inline code each come from a text element’s style:

Your AppAPP
Hello there, I am bold, italic, struck through, and code.

Bullet list

Your AppAPP
  • First item
  • Second item
  • Third item

Ordered list

Your AppAPP
  1. First
  2. Second
  3. Third

Indented (nested) list

Consecutive rich_text_list elements merge into one outline: a deeper indent nests inside the previous item, and matching a shallower list’s indent/style continues it, numbering on from where it left off. offset (a Builder/undocumented extension to the public schema) sets the starting number of an ordered list that starts a new outline; a list that continues an earlier one keeps counting and ignores it, as Slack does.

Your AppAPP
  1. First
  2. Second
    • Nested bullet
  3. Third (offset)

Quote

Your AppAPP
I am a basic rich text quote.

Preformatted / code block

Without a language, preformatted text renders as a plain monospace block:

Your AppAPP
npm install @nkootstra/block-kit

A language (a Builder/undocumented extension to the public schema) renders it as a syntax-highlighted fenced code block instead:

Your AppAPP
TypeScript
function Hello({ name }: { name: string }) {  return <p>Hello, {name}!</p>;}
Your AppAPP
Check out Slack or a styled link.

Resting the pointer on a link shows Slack’s link hover card: a “Link” heading with Open in new tab and Copy link buttons, over the URL as the payload wrote it. Like Slack’s, it opens only on hover, not on keyboard focus, and Escape closes it. A URL the renderer won’t follow (such as javascript:) gets no card.

User, channel, and usergroup mentions

Your AppAPP
Hey and , see #design and loop in @engineering. @here

Emoji

Text made up only of emoji (and whitespace) renders at a larger “jumbo” size, same as Slack:

Your AppAPP
:rocket::tada::checkered_flag:

Mixed into text, emoji render inline at normal text size:

Your AppAPP
Nice work :wave::skin-tone-3:

Dates

A date element formats a UNIX timestamp using curly-brace tokens like {date_short_pretty} and {time}; fallback is shown if formatting fails, and an optional url makes the whole date a link. As in Slack, a linked date isn’t underlined until it’s hovered or focused.

Your AppAPP
Due Jan 1, 2026 at 10:00 AM

Color swatch

A color element (a Builder/undocumented extension) prints a hex value next to a small swatch. A value that isn’t a hex colour prints without a fill:

Your AppAPP
Brand color: #1264A3

Tag

A tag element (a Builder/undocumented extension) draws its text as a coloured label, 24px tall, so its line is 2px taller than plain text. Slack’s blue is the only colour captured so far; every color draws as blue, from --sbk-tag-bg and --sbk-tag-text.

Your AppAPP
See In progress

Salesforce data field

A salesforce_data_field element (a Builder/undocumented extension) points at a field of a Salesforce record. The renderer can’t read the record, so it draws the field as Slack draws one it can’t reach: a greyed pill, 24.5px tall, with Salesforce’s cloud and “Record was deleted”. The record’s ID is on the pill as data-id.

Your AppAPP
See Record was deleted

Workflows, messages, files, canvases, lists, work objects and citations

These elements point at something only Slack can look up. The renderer shows each the way Slack shows it to someone who can’t open it, whatever text the payload gives:

Element Shows
workflow_mention A greyed pill with a trash can and “Deleted workflow”
message_mention A greyed pill with a speech bubble and “Private message”
file A greyed pill with a closed eye and “Hidden file”
canvas A blue pill with a lock and “Private canvas”
list_record A blue pill with a lock and “Private list”
work_object_mention A blue pill with the app’s icon and the element’s text, linked to url
attachment_mention The element’s text as a link to url, without an underline
citation A small blue chip, “1 · 🔗 example.com”, linked to url

A citation shows its index, then details.display_name (or its text) after Slack’s link icon.

A work object shows its app’s icon from resolvers.app, as Slack does (see Mentions and resolvers). Without it the icon is a square in the colour of a message’s placeholder avatar.

Your AppAPP
See Private canvas and A work object

Last updated on