Skip to main content

Plain-text input element

Example:

An example of a plain-text element

Fields

FieldTypeDescriptionRequired?
typeStringThe type of element. In this case type is always plain_text_input.Required
action_idStringAn identifier for the input value when the parent modal is submitted. You can use this when you receive a view_submission payload to identify the value of the input element. Should be unique among all other action_ids in the containing block. Maximum length is 255 characters.Optional
initial_valueStringThe initial value in the plain-text input when it is loaded.Optional
multilineBooleanIndicates whether the input will be a single line (false) or a larger textarea (true). Defaults to false.Optional
min_lengthIntegerThe minimum length of input that the user must provide. If the user provides less, they will receive an error. Acceptable values for this field are between 0 and 3000, inclusive.Optional
max_lengthIntegerThe maximum length of input that the user can provide. If the user provides more, they will receive an error. Acceptable values for this field are between 1 and 3000, inclusive.Optional
dispatch_action_configObjectA dispatch configuration object that determines when during text input the element returns a block_actions payload.Optional
focus_on_loadBooleanIndicates whether the element will be set to auto focus within the view object. Only one element can be set to true. Defaults to false.Optional
placeholderObjectA plain_text only text object that defines the placeholder text shown in the plain-text input. Maximum length for the text in this field is 150 characters.Optional

Example

An input block containing a plain-text input element.

{
"type": "input",
"block_id": "input123",
"label": {
"type": "plain_text",
"text": "Label of input"
},
"element": {
"type": "plain_text_input",
"action_id": "plain_input",
"placeholder": {
"type": "plain_text",
"text": "Enter some plain text"
}
}
}