Building Blocks
Here is the list of objects, block elements, and blocks you can use to create interactions for your apps.
Objects
Text object
Field | Type | Required? | Description |
---|---|---|---|
type | String | Yes | The type of text object that you want to add. The available values are |
text | String | Yes | The actual text. |
emoji | Boolean | No | Works with the |
Example
Option object
Field | Type | Required? | Description |
---|---|---|---|
text | Object | Yes | The text that is to be displayed on the menu. The value can either be |
value | String | Yes | The actual value that the option represents. |
Example
Block elements
button
Field | Type | Required? | Description |
---|---|---|---|
type | String | Yes | The type of the block element, in this case, |
text | Object | Yes | The text that is to be displayed on the menu. The value can either be |
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 |
actionId | String | Yes | A unique identifier for an action made upon the element. |
Example
image
Field | Type | Required? | Description |
---|---|---|---|
type | String | Yes | The type of the block element, in this case, |
imageUrl | String | Yes | The URL of the image. |
altText | String | Yes | The text describing the image being displayed. |
Example
overflow menu
Field | Type | Required? | Description |
---|---|---|---|
type | String | Yes | The type of the block element, in this case, |
options | Array | Yes | An array with the possible options (the |
actionId | String | Yes | A unique identifier for an action made upon the element. |
Example
plain text input
Field | Type | Required? | Description |
---|---|---|---|
type | String | Yes | The type of the block element, in this case, |
actionId | String | Yes | A unique identifier for an action made upon the element. |
placeholder | Object | Yes | A placeholder text for the input ( |
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. |
Example
static select menu
Field | Type | Required? | Description |
---|---|---|---|
type | String | Yes | The type of the block element, in this case, |
actionId | String | Yes | A unique identifier for an action made upon the element. |
placeholder | Object | Yes | A placeholder text for the input ( |
initialValue | String | No | The initial value selected ( |
options | Array | Yes | An array with the possible options (the |
Example
multi-static select menu
Field | Type | Required? | Description |
---|---|---|---|
type | String | Yes | The type of the block element, in this case, |
actionId | String | Yes | A unique identifier for an action made upon the element. |
placeholder | Object | Yes | A placeholder text for the input ( |
initialValue | Array of strings | No | The initial values selected ( |
options | Array | Yes | An array with the possible options (the |
Example
Blocks
section
Field | Type | Required? | Description |
---|---|---|---|
blockId | String | No | A unique identifier for the block. |
type | String | Yes | The type of the block, in this case, |
text | Object | Yes | The text that is to be displayed on the button. The value can either be |
accessory | Object | No | One element that can be a |
Example
Notice how the section block and the button element are used in the Contextual Bar app.
divider
Field | Type | Required? | Description |
---|---|---|---|
blockId | String | No | A unique identifier for the block. |
type | String | Yes | The type of the block, in this case, |
Example
image
Field | Type | Required? | Description |
---|---|---|---|
blockId | String | No | A unique identifier for the block. |
type | String | Yes | The type of the block, in this case, |
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 |
Example
actions
Field | Type | Required? | Description |
---|---|---|---|
blockId | String | No | A unique identifier for the block. |
type | String | Yes | The type of the block, in this case, |
elements | Array | Yes | A list of interactive block elements. |
Example
context
Field | Type | Required? | Description |
---|---|---|---|
blockId | String | No | A unique identifier for the block. |
type | String | Yes | The type of the block, in this case, |
elements | Array | Yes | A list of block elements. Allowed elements are |
Example
input
Field | Type | Required? | Description |
---|---|---|---|
blockId | String | No | A unique identifier for the block. |
type | String | Yes | The type of the block, in this case, |
element | Array | Yes | The input element, that can be |
Example
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