Input block
A labeled form field for a modal or App Home, the only way to collect input from a user.
input pairs a label with one form element: a text field, a select, a date or time picker,
checkboxes, or radio buttons. It’s the field type modals and App Home tabs use to collect values a
user submits. A message can hold one too: it renders without the “(optional)” suffix, and its value
reaches state once the user sets one (see State).
New ticket
Fields
typestring
Always input.
stringlabelPlainTextElement
The bold label above the element. Maximum length is 2000 characters.
PlainTextElementelementInputBlockElement
The single form element this field wraps: a text input, select, picker, checkboxes, or radio buttons.
InputBlockElementhint?PlainTextElement
Muted helper text below the element. Maximum length is 2000 characters.
PlainTextElementoptional?boolean
Lets the modal submit with this field empty. Not shown on a message-surface preview, only in a modal or Home tab form.
booleanfalsedispatch_action?boolean
Sends a block_actions payload as the user interacts with the element. Without it, the value only arrives on submit.
booleanfalseblock_id?string
A unique identifier for this block. Auto-generated if omitted. Maximum length is 255 characters.
stringExamples
Plain text input
Multiline plain text input
Checkboxes
Radio buttons
Static select
Every select variant renders the same way inside input. See select menus
for multi_static_select, users_select, external_select, and the rest.
Multi-user select
Date and time pickers
Optional field
An optional field shows an “(optional)” suffix next to its label, in a modal or Home tab form:
Hint
Interactivity
By default an input block’s element sends no actions: its value only reaches state, and your
app reads it from the view_submission payload. Set dispatch_action: true to also get a
block_actions payload as the user interacts, like an element in an actions block.
Checkboxes, radio buttons, selects and pickers then dispatch on every change. Text inputs
(plain_text_input, email_text_input, url_text_input, number_input) and rich_text_input
dispatch on the trigger in their dispatch_action_config, which Slack gives all five:
on_enter_pressed(the default): Enter sends the action. A multilineplain_text_inputnever dispatches on Enter, which inserts a newline instead; in arich_text_input, Shift+Enter adds a line.on_character_entered: one action with the full value once typing pauses for 300ms. Slack coalesces keystrokes the same way (Block Kit Builder sends a single action for a quickly typed word) without documenting its interval. An Enter dispatch is sent at once.
Block Kit Builder sends nothing on Enter from a url_text_input or rich_text_input; the package
follows Slack’s docs, which give both elements dispatch_action_config.
State in a modal or Home tab
A view’s state.values holds every input block’s element, as in Slack’s view_submission: one the
user hasn’t touched is reported with its empty value, null for a single value (value,
selected_option, selected_date, selected_user, …) and [] for a multi-value element
(selected_options, selected_users, …). A rich_text_input is reported as just its type, and
an initial value is reported as set. In a message, only elements with a value are reported.
onAction receives, on pressing Enter:
{
"type": "plain_text_input",
"action_id": "plain_text_input-action",
"block_id": "<the input block's block_id>",
"value": "…"
}
A single-line on_enter_pressed-dispatching plain text input shows a “Press ‘enter’ to submit”
hint below it, matching Slack’s Builder preview (number, email and URL inputs don’t). With the block’s own hint, both share one line, the hint
ending in a period:
Any other element dispatches on change. Tick a box to see the action: