Objects

Prev Next

Objects are common JSON objects that are used inside blocks and block elements.

Text object

This is an object containing some text.

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.

Example

{
  type: 'plain_text',
  text: 'lorem ipsum 🚀',
  emoji: true,
}

Options object

This object is usually used to define options in interactive elements such as select menus and radio buttons.

Field

Type

Required?

Description

text

Object{}

Yes

The text object that is to be displayed on the menu.

value

String

Yes

The value that the option represents.

Example

{
  value: 'option_1',
  text: {
      type: 'plain_text',
      text: 'lorem ipsum 🚀',
      emoji: true,
    }
}