{ type:'section', blockId:'section_1', text: { type:'plain_text', text:'lorem ipsum 🚀', emoji:true, } accessory: { /* one of the accessory elements */ } ,}
Notice how the section block and the button element are used in the Contextual Bar app.
{ type:'actions', blockId:'actions_1', elements: [ /* block elements */ ]}
context
Example
{ type:'context', blockId:'context_1', elements: [ /* block elements */ ]}
input
Example
{ type:'input', blockId:'input_1', element: { /* input element */ }}
Now that we've seen the different building blocks that can be used for our apps, let's take a look at how to use action buttons to initiate a set of actions in the next section.
Last updated
Rocket.Chat versions receive support for six months after release.
Field
Type
Required?
Description
Field
Type
Required?
Description
Field
Type
Required?
Description
Field
Type
Required?
Description
Field
Type
Required?
Description
Field
Type
Required?
Description
Field
Type
Required?
Description
Field
Type
Required?
Description
Field
Type
Required?
Description
Field
Type
Required?
Description
Field
Type
Required?
Description
Field
Type
Required?
Description
Field
Type
Required?
Description
Field
Type
Required?
Description
type
String
Yes
The type of text object that you want to add. The available values are plain_text and mrkdwn.
text
String
Yes
The actual text.
emoji
Boolean
No
Works with the plain_text type.
text
Object
Yes
The text that is to be displayed on the menu. The value can either be plain_text or mrkdwn.
value
String
Yes
The actual value that the option represents.
type
String
Yes
The type of the block element, in this case,button.
text
Object
Yes
The text that is to be displayed on the menu. The value can either be plain_text or mrkdwn.
value
String
No
A value sent along with the button information when an action is made upon the element.
url
String
No
A URL that the button points to.
style
String
No
The style of the button. The value can either be primary or danger.
actionId
String
Yes
A unique identifier for an action made upon the element.
type
String
Yes
The type of the block element, in this case, image.
imageUrl
String
Yes
The URL of the image.
altText
String
Yes
The text describing the image being displayed.
type
String
Yes
The type of the block element, in this case, overflow.
options
Array
Yes
An array with the possible options (the options object).
actionId
String
Yes
A unique identifier for an action made upon the element.
type
String
Yes
The type of the block element, in this case, plain_text_input.
actionId
String
Yes
A unique identifier for an action made upon the element.
placeholder
Object
Yes
A placeholder text for the input (plain text object).
initialValue
String
No
The initial value of the field.
multiline
Boolean
No
A flag that indicates whether the field should be a single line (default) or a larger text area.
type
String
Yes
The type of the block element, in this case, static_select.
actionId
String
Yes
A unique identifier for an action made upon the element.
placeholder
Object
Yes
A placeholder text for the input (plain text object).
initialValue
String
No
The initial value selected (value field from the options object).
options
Array
Yes
An array with the possible options (the options object).
type
String
Yes
The type of the block element, in this case, multi_static_select.
actionId
String
Yes
A unique identifier for an action made upon the element.
placeholder
Object
Yes
A placeholder text for the input (plain text object).
initialValue
Array of strings
No
The initial values selected (value field from the options object).
options
Array
Yes
An array with the possible options (the options object).
blockId
String
No
A unique identifier for the block.
type
String
Yes
The type of the block, in this case, section.
text
Object
Yes
The text that is to be displayed on the button. The value can either be plain_text or mrkdwn.
accessory
Object
No
One element that can be a button element, an image element, or an overflow menu.
blockId
String
No
A unique identifier for the block.
type
String
Yes
The type of the block, in this case, divider.
blockId
String
No
A unique identifier for the block.
type
String
Yes
The type of the block, in this case, image.
imageUrl
String
Yes
The URL of the image.
altText
String
Yes
A text describing the image being displayed.
title
Object
No
The text to be displayed as the image's title. The value can either be plain_text or mrkdwn.
blockId
String
No
A unique identifier for the block.
type
String
Yes
The type of the block, in this case, actions.
elements
Array
Yes
A list of interactive block elements.
blockId
String
No
A unique identifier for the block.
type
String
Yes
The type of the block, in this case, context.
elements
Array
Yes
A list of block elements. Allowed elements are plain text object and image element.
blockId
String
No
A unique identifier for the block.
type
String
Yes
The type of the block, in this case, input.
element
Array
Yes
The input element, that can be plain text input, static select menu, and multi static select menu.