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

Rich text input

A formatted text field, with Slack's formatting toolbar, that reports a rich_text value.

rich_text_input collects text and hands it back as a rich_text block, the same structure Slack uses for a message composed in its own WYSIWYG editor. It’s an input-block-only element: it doesn’t appear in an actions block or as a section accessory, and, like file_input, Slack only supports it in modals, not Home tabs.

New entry

Summary

Fields

PropType
type"rich_text_input"

Always `rich_text_input`.

Type"rich_text_input"
action_id?string

Identifies this action in the interaction payload and as the key in `state.values`. Maximum length is 255 characters.

Typestring
initial_value?RichTextBlock

The rich_text content shown when the surface loads.

TypeRichTextBlock
placeholder?PlainTextElement

Grey placeholder text shown when the field is empty. Maximum length is 150 characters.

TypePlainTextElement
min_lines?number

The minimum number of lines shown. Must be between 1 and 100.

Typenumber
max_lines?number

The maximum number of lines shown before the field scrolls. Must be between 1 and 100.

Typenumber
Default8
dispatch_action_config?DispatchActionConfig

Configures which edits fire a `block_actions` payload while typing.

TypeDispatchActionConfig
focus_on_load?boolean

Focuses this field when the surface loads. Only one element per view can set this.

Typeboolean
Defaultfalse

Examples

With an initial value

Your AppAPP
Release notes
Fixed the login redirect loop.

initial_value takes a full rich_text block, the same shape you’d get back from the element itself, not a plain string.

Sizing the field

Your AppAPP
Bio

min_lines sets the field’s starting height; max_lines (8 by default) caps how tall it grows before it scrolls.

Interactivity

Typing calls onAction with the current content wrapped as a rich_text block, under rich_text_value:

{
  "type": "rich_text_input",
  "action_id": "notes_input",
  "block_id": "notes",
  "action_ts": "1706000000.000100",
  "rich_text_value": {
    "type": "rich_text",
    "elements": [
      {
        "type": "rich_text_section",
        "elements": [{ "type": "text", "text": "Fixed the login redirect loop." }]
      }
    ]
  }
}

Reading the value

Every edit (and the initial value, if any) is written to state.values as { type, rich_text_value }:

{
  "notes": {
    "notes_input": {
      "type": "rich_text_input",
      "rich_text_value": {
        "type": "rich_text",
        "elements": [
          {
            "type": "rich_text_section",
            "elements": [{ "type": "text", "text": "Fixed the login redirect loop." }]
          }
        ]
      }
    }
  }
}

Was this page helpful?