Composition Objects

Some components accept complex property values that must take a certain shape.

A dialog that provides a confirmation step. This dialog asks the user to confirm their action via confirm and deny buttons.

Confirm Example

Example

KeyTypeRequiredDescription
confirmObjectYesAn object describing a dialog that provides a confirmation step.
confirm.titleString, Expression, Plain TextYesThe title of the confirmation dialog.
confirm.textString, Expression, Plain TextYesExplanatory text to display to the user in the confirmation dialog.
confirm.confirmString, Expression, Plain TextYesThe text of the confirm button.
confirm.denyString, Expression, Plain TextYesThe text of the cancel button.
confirm.styleString, ExpressionNoDefines the color scheme applied to the confirm button. The value danger displays the button with a red background on desktop, or red text on mobile. The value primary displays the button with a green background on desktop, or blue text on mobile. The default value is primary.

Identifies the data provider for an external select component.

Example

KeyTypeRequiredDescription
datasourceString, Object, ExpressionYesA valid data provider identifier string or object containing an identifier and properties to be passed into a data provider.
datasource.definitionString, Object, ExpressionYesA valid data provider identifier is required to be present within the datasource if the datasource takes the form of an Object. Use the format namespace__dataproviderName.
datasource.propertiesObject, ExpressionNoContains any parameters to be passed into the option data provider.

Used in the conversations select component to filter which conversations are shown in the picker.

Example

KeyTypeRequiredDescription
filterObjectYesUsed in the conversations select component to filter which conversations are shown in the picker.
filter.includeArrayYesList of conversation types to include. Possible values: public—public channels, private—private channels, im—direct messages, mpim—multi-party direct messages.
filter.excludeExternalSharedBoolean, ExpressionNoExclude external shared channels from the conversation list. The default value is false.
filter.excludeBotUsersBoolean, ExpressionNoExclude bot users from the conversation list. The default value is false.

Available in: Checkbox Group | Overflow | Radio Group | Select

An object that represents a single selectable item.

Example

KeyTypeRequiredDescription
optionsArray, ExpressionYesA list of options.
options.identifierStringYesA string used to identify the option.
options.labelString, Expression, Plain Text, MrkdwnYesA label for the option on a checkbox group or radio group
String, Expression, Plain TextYesA label for the option on overflow or select.
options.valueBooleanNoThe value of the option. The value key is only available in checkbox groups.
options.descriptionString, Plain Text, ExpressionNoThe description of the option.
options.urlStringNoA URL to load in the user's browser when the option is selected. The url key is available only in overflow menus.

Available in: Select

Provides a way to group options in a select component.

Example

KeyTypeRequiredDescription
optionGroupsArray, ExpressionYesA list of option groups.
optionGroups.labelString, Plain Text, ExpressionYesA label for the group.
optionGroups.optionsArray of OptionsYesSelectable items in the options group.

Many properties accept a string, mrkdwn, or plain text.

For these properties, if the value is a string, the component renders plain text. If the value is an object it must be a Mrkdwn or Plain Text object.

Slack's implementation of markdown is called mrkdwn.

For more details on formatting with mrkdwn, see Slack's formatting documentation.

Examples

This example creates mrkdwn text with simple formatting and an emoji.

By default, control characters in markdown are encoded, including the <, >, and & characters. To use control characters in mrkdwn to tag users or denote links, set the disableEncoding property to true.

This example creates mrkdwn text with a link and an emoji. If disableEncoding is false (default), the angular brackets are rendered as they are.

This example renders the text http://salesforce.com with a link. The link is automatically parsed because verbatim is set to false. If verbatim is true (default), the text renders without a link.

This example creates mrkdwn text in a section and field component.

Keys

KeyTypeRequiredDescription
textObjectYesA text object.
typeStringYesThe value must be mrkdwn.
textStringYesThe text.
verbatimBooleanNoWhen set to false, Slack detects and parses certain values like links in markdown. The default value is true. To turn on automatic parsing, set this key to false. For more information, see Slack's text object documentation.
disableEncodingBooleanNoBy default (false), control characters are encoded within markdown. To turn off automatic encoding, set this key to true.

Renders a plain text value with optional support for emojis.

Example

Keys

KeyTypeRequiredDescription
textObjectYesA text object.
typeStringNoThe default value is plain_text.
textStringYesThe text.
emojiBooleanNoSlack doesn't support emojis in plain text. To turn on emoji support, set this key to true. For more information, see Slack's text object documentation.