UIKit building blocks

Objects

Text object

Field
Type
Required?
Description
type
String
Yes
The available values are plain_text and mrkdwn
text
String
Yes
The actual text
emoji
Boolean
No
Works with the plain_text type
Example
1
{
2
type: 'plain_text',
3
text: 'lorem ipsum πŸš€',
4
emoji: true,
5
}
Copied!

Option object

Field
Type
Required?
Description
text
Object
Yes
The text object to be displayed at the menu. Can be either plain_text or mrkdwn
value
String
Yes
The actual value the option represents

Example

1
{
2
value: 'option_1',
3
text: {
4
type: 'plain_text',
5
text: 'lorem ipsum πŸš€',
6
emoji: true,
7
}
8
}
Copied!

Block elements

button

Field
Type
Required?
Description
type
String
Yes
The type of the block element, that in this case is 'button'
text
Object
Yes
The text object to be displayed in the button. Can be either 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
An URL *
style
String
No
The style of the button. Can be either primary or danger
actionId
String
Yes
An unique identifier for an action make upon the element

Example

1
{
2
type: 'button',
3
text: {
4
type: 'plain_text',
5
text: 'danger❗',
6
emoji: true,
7
},
8
actionId: 'button_1_danger',
9
style: 'danger',
10
}
Copied!

image

Field
Type
Required?
Description
type
String
Yes
The type of the block element, that in this case is 'image'
imageUrl
String
Yes
The URL of the image
altText
String
Yes
A text describing the image being displayed

Example

1
{
2
type: 'image',
3
imageUrl: 'https://picsum.photos/200/300',
4
altText: 'An image',
5
}
Copied!

overflow menu

Field
Type
Required?
Description
type
String
Yes
The type of the block element, that in this case is 'overflow'
options
Array
Yes
An array with the possible options (the option object)
actionId
String
Yes
An unique identifier for an action make upon the element

Example

1
{
2
type: 'overflow',
3
actionId: 'overflow_1',
4
options: [
5
{
6
value: 'option_1',
7
text: {
8
type: 'plain_text',
9
text: 'lorem ipsum πŸš€',
10
emoji: true,
11
}
12
},
13
{
14
value: 'option_2',
15
text: {
16
type: 'plain_text',
17
text: 'lorem ipsum πŸš€',
18
emoji: true,
19
}
20
},
21
],
22
}
Copied!

plain text input

Field
Type
Required?
Description
type
String
Yes
The type of the block element, that in this case is 'plain_text_input'
actionId
String
Yes
An unique identifier for an action make 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 bigger text area

Example

1
{
2
type: 'plain_text_input',
3
actionId: 'plain_text_input_1',
4
placeholder: {
5
type: 'plain_text',
6
text: 'Enter name',
7
emoji: true,
8
},
9
initialValue: 'John Doe',
10
multiline: false,
11
}
Copied!

static select menu

Field
Type
Required?
Description
type
String
Yes
The type of the block element, that in this case is 'static_select'
actionId
String
Yes
An unique identifier for an action make 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 option object)
options
Array
Yes
An array with the possible options (the option object)

Example

1
{
2
type: 'static_select',
3
actionId: 'overflow_1',
4
initialValue: 'option_2',
5
options: [
6
{
7
value: 'option_1',
8
text: {
9
type: 'plain_text',
10
text: 'lorem ipsum πŸš€',
11
emoji: true,
12
}
13
},
14
{
15
value: 'option_2',
16
text: {
17
type: 'plain_text',
18
text: 'lorem ipsum πŸš€',
19
emoji: true,
20
}
21
},
22
],
23
placeholder: {
24
type: 'plain_text',
25
text: 'Select an item',
26
},
27
}
Copied!

multi static select menu

Field
Type
Required?
Description
type
String
Yes
The type of the block element, that in this case is 'multi_static_select'
actionId
String
Yes
An unique identifier for an action make 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 option object)
options
Array
Yes
An array with the possible options (the option object)

Example

1
{
2
type: 'static_select',
3
actionId: 'overflow_1',
4
initialValue: ['option_1' ,'option_2'],
5
options: [
6
{
7
value: 'option_1',
8
text: {
9
type: 'plain_text',
10
text: 'lorem ipsum πŸš€',
11
emoji: true,
12
}
13
},
14
{
15
value: 'option_2',
16
text: {
17
type: 'plain_text',
18
text: 'lorem ipsum πŸš€',
19
emoji: true,
20
}
21
},
22
],
23
placeholder: {
24
type: 'plain_text',
25
text: 'Select an item',
26
},
27
}
Copied!

Blocks

section

Field
Type
Required?
Description
blockId
String
No
An unique identifier for the block
type
String
Yes
The type of the block, that in this case is 'section'
text
Object
Yes
The text object to be displayed in the button. Can be either plain_text or mrkdwn
accessory
Object
No
One element that can be a button element, an image element or a overflow menu

Example

1
{
2
type: 'section',
3
blockId: 'section_1',
4
text: {
5
type: 'plain_text',
6
text: 'lorem ipsum πŸš€',
7
emoji: true,
8
}
9
accessory: { /* one of the accessory elements */ } ,
10
}
Copied!

divider

Field
Type
Required?
Description
blockId
String
No
An unique identifier for the block
type
String
Yes
The type of the block, that in this case is 'divider'

Example

1
{
2
type: 'divider',
3
blockId: 'divider_1',
4
}
Copied!

image

Field
Type
Required?
Description
blockId
String
No
An unique identifier for the block
type
String
Yes
The type of the block, that in this case is 'image'
imageUrl
String
Yes
The URL of the image
altText
String
Yes
A text describing the image being displayed
title
Object
No
The text object to be displayed as the image's title. Can be either plain_text or mrkdwn

Example

1
{
2
type: 'image',
3
blockId: 'image_1',
4
imageUrl: 'https://picsum.photos/200/300',
5
altText: 'An image',
6
title: {
7
type: 'plain_text',
8
text: 'lorem ipsum πŸš€',
9
emoji: true,
10
}
11
}
Copied!

actions

Field
Type
Required?
Description
blockId
String
No
An unique identifier for the block
type
String
Yes
The type of the block, that in this case is 'actions'
elements
Array
Yes
A list of interactive block elements

Example

1
{
2
type: 'actions',
3
blockId: 'actions_1',
4
elements: [ /* block elements */ ]
5
}
Copied!

context

Field
Type
Required?
Description
blockId
String
No
An unique identifier for the block
type
String
Yes
The type of the block, that in this case is 'context'
elements
Array
Yes
A list of block elements. Allowed elements are plain text object and image element

Example

1
{
2
type: 'context',
3
blockId: 'context_1',
4
elements: [ /* block elements */ ]
5
}
Copied!

input

Field
Type
Required?
Description
blockId
String
No
An unique identifier for the block
type
String
Yes
The type of the block, that in this case is 'input'
element
Array
Yes
The input element, that can be plain text input, static select menu and multi static select menu

Example

1
{
2
type: 'input',
3
blockId: 'input_1',
4
element: { /* input element */ }
5
}
Copied!
Last modified 9h ago