Skip to main content

Elements

Button

Class

Button(text: TextLike, action_id: str, url: Optional[str] = None, value: Optional[str] = None, style: Optional[str] = None, confirm: Optional[ConfirmationDialogue] = None, accessibility_label: Optional[str] = None)

An interactive element that inserts a button. The button can be a trigger for anything from opening a simple link to starting a complex workflow.

See: https://api.slack.com/reference/block-kit/block-elements#button.

Arguments

ArgumentTypeDescription
textTextLiketext on the button (plaintext only; max 75 chars).
action_idstran identifier so the source of the action can be known.
urlOptional[str]a URL to load in the user's browser when the button is clicked.
valueOptional[str]the value sent with the interaction payload.
styleOptional[str]the visual style of the button, one of primary, danger.
confirmOptional[ConfirmationDialogue]a ConfirmationDialogue object that will be presented when
the button is clicked.
accessibility_labelOptional[str]a string label for longer descriptive text about
a button element. Used by screen readers (max 75 chars).

Raises: InvalidUsageError: if any of the provided arguments fail validation.

ButtonStyle

Class

Utility class for determining the style of Buttons and WorkflowButtons.

ChannelMultiSelectMenu

Class

ChannelMultiSelectMenu(action_id: str, initial_channels: Optional[List[str]] = None, confirm: ConfirmationDialogue = None, max_selected_items: Optional[int] = None, focus_on_load: bool = False, placeholder: Optional[TextLike] = None)

This interactive UI element allows users to select multiple channels visible to the current user in the active workspace.

See: https://api.slack.com/reference/block-kit/block-elements#channel_multi_select.

Arguments

ArgumentTypeDescription
action_idstran identifier so the source of the action can be known.
initial_channelsOptional[List[str]]a list of conversation IDs as strings that will
already be selected when the menu renders.
confirmConfirmationDialoguea ConfirmationDialogue object that will be presented when
the menu is used.
max_selected_itemsOptional[int]the maximum number of items that can be selected
in the menu.
focus_on_loadboolwhether or not the menu will be set to autofocus
within the view object.
placeholderOptional[TextLike]a plain-text Text object (max 150 chars) that shows
in the menu when it's initially rendered.

Errors

ErrorWhen
InvalidUsageErrorif any of the provided arguments fail validation.

ChannelSelectMenu

Class

ChannelSelectMenu(action_id: str, initial_channel: Optional[str] = None, confirm: Optional[ConfirmationDialogue] = None, response_url_enabled: Optional[bool] = False, focus_on_load: bool = False, placeholder: Optional[TextLike] = None)

A select menu interactive UI element, sourced with a list of public channels visible to the current user.

See: https://api.slack.com/reference/block-kit/block-elements#channels_select.

Arguments

ArgumentTypeDescription
action_idstran identifier so the source of the action can be known.
initial_channelOptional[str]the single (string) user ID that will be initially selected
when first presented to the user.
confirmOptional[ConfirmationDialogue]a ConfirmationDialogue object that will be presented when an
option in the overflow menu is selected.
response_url_enabledOptional[bool]When set to true, the view_submission payload from the
menu's parent view will contain a response_url. (This response_url can be
used for message responses).
focus_on_loadboolwhether or not the input will be set to autofocus
within the view object.
placeholderOptional[TextLike]a plain-text Text object (max 150 chars) that shows
in the input when it's initially rendered.

Errors

ErrorWhen
InvalidUsageErrorif any of the provided arguments fail validation.

CheckboxGroup

Class

CheckboxGroup(action_id: str, options: Union[Option, List[Option]], initial_options: Optional[Union[Option, List[Option]]] = None, confirm: ConfirmationDialogue = None, focus_on_load: bool = False)

A checkbox group that allows a user to choose multiple items from a list of possible options.

See: https://api.slack.com/reference/block-kit/block-elements#checkboxes.

Arguments

ArgumentTypeDescription
action_idstran identifier so the source of the action can be known.
optionsUnion[Option, List[Option]]a list of
Option objects that will form
the content of the checkbox group.
initial_optionsOptional[Union[Option, List[Option]]]a list of
Option objects that will be
initially selected when first presented to the user.
confirmConfirmationDialoguea ConfirmationDialogue object that will be presented when
the checkbox group is used.
focus_on_loadboolwhether or not the checkbox group will be set to autofocus
within the view object.

Errors

ErrorWhen
InvalidUsageErrorif any of the provided arguments fail validation.

ConversationMultiSelectMenu

Class

ConversationMultiSelectMenu(action_id: str, initial_conversations: Optional[List[str]] = None, default_to_current_conversation: Optional[bool] = False, confirm: ConfirmationDialogue = None, max_selected_items: Optional[int] = None, filter: Optional[ConversationFilter] = None, focus_on_load: Optional[bool] = False, placeholder: Optional[TextLike] = None)

This interactive UI element allows users to select multiple conversations visible to the current user in the active workspace.

See: https://api.slack.com/reference/block-kit/block-elements#conversation_multi_select.

Arguments

ArgumentTypeDescription
action_idstran identifier so the source of the action can be known.
initial_conversationsOptional[List[str]]a list of conversation IDs as strings that will
already be selected when the menu renders.
default_to_current_conversationOptional[bool]Pre-populates the select menu with the
conversation that the user was viewing when they opened the modal
(defaults to False).
confirmConfirmationDialoguea ConfirmationDialogue object that will be presented when
the menu is used.
max_selected_itemsOptional[int]the maximum number of items that can be selected
in the menu.
filterOptional[ConversationFilter]a Filter
object that filters out conversations that don't match the settings
of the filter.
focus_on_loadOptional[bool]whether or not the menu will be set to autofocus
within the view object.
placeholderOptional[TextLike]a plain-text Text object (max 150 chars) that shows
in the menu when it's initially rendered.

Errors

ErrorWhen
InvalidUsageErrorif any of the provided arguments fail validation.

ConversationSelectMenu

Class

ConversationSelectMenu(action_id: str, initial_conversation: Optional[str] = None, default_to_current_conversation: Optional[bool] = False, confirm: Optional[ConfirmationDialogue] = None, response_url_enabled: Optional[bool] = False, filter: Optional[ConversationFilter] = None, focus_on_load: bool = False, placeholder: Optional[TextLike] = None)

A select menu interactive UI element, sourced with a list of public and private channels, DMs, and MPIMs visible to the current user.

See: https://api.slack.com/reference/block-kit/block-elements#conversations_select.

Arguments

ArgumentTypeDescription
action_idstran identifier so the source of the action can be known.
initial_conversationOptional[str]the single (string) coversation ID that will be initially
selected when first presented to the user.
default_to_current_conversationOptional[bool]Pre-populates the select menu with the
conversation that the user was viewing when they opened the modal
(defaults to False).
confirmOptional[ConfirmationDialogue]a ConfirmationDialogue object that will be presented when an
option in the overflow menu is selected.
response_url_enabledOptional[bool]When set to true, the view_submission payload from the
menu's parent view will contain a response_url. (This response_url can be
used for message responses).
filterOptional[ConversationFilter]a Filter
object that filters out conversations that don't match the settings
of the filter.
focus_on_loadboolwhether or not the input will be set to autofocus
within the view object.
placeholderOptional[TextLike]a plain-text Text object (max 150 chars) that shows
in the input when it's initially rendered.

Errors

ErrorWhen
InvalidUsageErrorif any of the provided arguments fail validation.

DatePicker

Class

DatePicker(action_id: str, initial_date: Optional[str] = None, confirm: ConfirmationDialogue = None, focus_on_load: bool = False, placeholder: Optional[TextLike] = None)

Interactive element that allows users to select a date from a calendar.

See: https://api.slack.com/reference/block-kit/block-elements#datepicker.

Arguments

ArgumentTypeDescription
action_idstran identifier so the source of the action can be known.
initial_dateOptional[str]the date (in YYYY-MM-DD format) that will appear on the
picker when it first renders.
confirmConfirmationDialoguea ConfirmationDialogue object that will be presented when
the date picker is clicked.
focus_on_loadboolwhether or not the date picker will be set to autofocus
within the view object.
placeholderOptional[TextLike]a TextType.PLAINTEXT Text object that defines what text
will initially appear on the picker.

Errors

ErrorWhen
InvalidUsageErrorif any of the provided arguments fail validation.

DateTimePicker

Class

DateTimePicker(action_id: str, initial_datetime: Optional[int] = None, confirm: ConfirmationDialogue = None, focus_on_load: bool = False)

Allows users to select both a date and a time of day.

Provides the date-time formatted as a Unix timestamp.

See: https://api.slack.com/reference/block-kit/block-elements#datetimepicker.

Arguments

ArgumentTypeDescription
action_idstran identifier so the source of the action can be known.
initial_datetimeOptional[int]the initial value the date-time picker will be set to
when it first renders.
confirmConfirmationDialoguea ConfirmationDialogue object that will be presented when
the button is date-time picker is used.
focus_on_loadboolwhether or not the datetime picker will be set to autofocus
within the view object.

Raises: InvalidUsageError: if any of the provided arguments fail validation.

EmailInput

Class

EmailInput(action_id: str, initial_value: Optional[str] = None, dispatch_action_config: Optional[DispatchActionConfiguration] = None, focus_on_load: bool = False, placeholder: Optional[TextLike] = None)

Allows user to enter an email into a single-line text field.

See: https://api.slack.com/reference/block-kit/block-elements#email.

Arguments

ArgumentTypeDescription
action_idstran identifier so the source of the action can be known.
initial_valueOptional[str]The initial value in the email input when it is loaded.
dispatch_action_configOptional[DispatchActionConfiguration]a DispatchActionConfiguration object that
determines when during text input the element returns a
block_actions payload.
focus_on_loadboolwhether or not the email input will be set to autofocus
within the view object.
placeholderOptional[TextLike]a TextType.PLAINTEXT Text object that defines what text
will initially appear in the input field.

Errors

ErrorWhen
InvalidUsageErrorif any of the provided arguments fail validation.

ExternalMultiSelectMenu

Class

ExternalMultiSelectMenu(action_id: str, min_query_length: Optional[int] = None, initial_options: Optional[Union[Option, List[Option], OptionGroup, List[OptionGroup]]] = None, confirm: ConfirmationDialogue = None, max_selected_items: Optional[int] = None, focus_on_load: bool = False, placeholder: Optional[TextLike] = None)

An interactive UI element that loads its options from an external data source, allowing for a dynamic list of options.

See: https://api.slack.com/reference/block-kit/block-elements#external_multi_select.

Arguments

ArgumentTypeDescription
action_idstran identifier so the source of the action can be known.
min_query_lengthOptional[int]minimum number of characters entered before the query
is dispactched (defaults to 3 if not provided).
initial_optionsOptional[Union[Option, List[Option], OptionGroup, List[OptionGroup]]]the Options
to be intially selected when the element is first rendered.
confirmConfirmationDialoguea ConfirmationDialogue object that will be presented when
the menu is used.
max_selected_itemsOptional[int]the highest number of items from the list that
can be selected at one time.
focus_on_loadboolwhether or not the menu will be set to autofocus
within the view object.
placeholderOptional[TextLike]a plain-text Text object (max 150 chars) that shows
in the menu when it's initially rendered.

Errors

ErrorWhen
InvalidUsageErrorif any of the provided arguments fail validation.

ExternalSelectMenu

Class

ExternalSelectMenu(action_id: str, initial_option: Union[Option, OptionGroup] = None, min_query_length: Optional[int] = None, confirm: Optional[ConfirmationDialogue] = None, focus_on_load: bool = False, placeholder: Optional[TextLike] = None)

A select menu interactive UI element, sourced with externally provided options.

See: https://api.slack.com/reference/block-kit/block-elements#external_select.

Arguments

ArgumentTypeDescription
action_idstran identifier so the source of the action can be known.
initial_optionUnion[Option, OptionGroup]an
Option object that will be
initially selected when first presented to the user.
min_query_lengthOptional[int]minimum number of characters entered before the query
is dispactched (defaults to 3 if not provided).
confirmOptional[ConfirmationDialogue]a ConfirmationDialogue object that will be presented when an
option in the overflow menu is selected.
focus_on_loadboolwhether or not the input will be set to autofocus
within the view object.
placeholderOptional[TextLike]a plain-text Text object (max 150 chars) that shows
in the input when it's initially rendered.

Errors

ErrorWhen
InvalidUsageErrorif any of the provided arguments fail validation.

FileInput

Class

FileInput(action_id: Optional[str] = None, filetypes: Optional[Union[str, List[str]]] = None, max_files: Optional[int] = None)

An interactive element that allows users to upload files.

See: https://api.slack.com/reference/block-kit/block-elements#file_input.

Arguments

ArgumentTypeDescription
action_idOptional[str]an identifier so the source of the action can be known.
filetypesOptional[Union[str, List[str]]]a list of file extensions (as strings) that will be accepted
for upload.
max_filesOptional[int]the maximum number of files that can be uploaded (between 1
and 10).

Errors

ErrorWhen
InvalidUsageErrorif any of the provided arguments fail validation.

Image

Class

Image(alt_text: str = ' ', image_url: Optional[str] = None, slack_file: Optional[SlackFile] = None)

An element to insert an image - this element can be used in section and context blocks only. If you want a block with only an image in it, you're looking for the Image block.

You must provide either one of image_url or slack_file

See: https://api.slack.com/reference/block-kit/block-elements#image.

Arguments

ArgumentTypeDescription
alt_textstra plain-text-only summary of the content of the image.
image_urlOptional[str]a URL for a publicly hosted image (the user must provide
either image_url or slack_file).
slack_fileOptional[SlackFile]a SlackFile
(the user must provide either image_url or slack_file).

Errors

ErrorWhen
InvalidUsageErrorif any of the provided arguments fail validation,
or both/neither of image_url and slack_file are provided.

NumberInput

Class

NumberInput(is_decimal_allowed: bool, action_id: Optional[str] = None, initial_value: Optional[str] = None, min_value: Optional[Union[float, int]] = None, max_value: Optional[Union[float, int]] = None, dispatch_action_config: Optional[DispatchActionConfiguration] = None, focus_on_load: bool = False, placeholder: Optional[TextLike] = None)

This input elements accepts both integer and decimal numbers. For example, 0.25, 5.5, and -10 are all valid input values.

See https://api.slack.com/reference/block-kit/block-elements#number.

Arguments

ArgumentTypeDescription
is_decimal_allowedboolwhether to accept decimal values as input.
action_idOptional[str]an identifier so the source of the action can be known.
initial_valueOptional[str]the initial value in the number input when it is loaded.
min_valueOptional[Union[float, int]]minimum accepted value for the input field.
max_valueOptional[Union[float, int]]maximum accepted value for the input field.
dispatch_action_configOptional[DispatchActionConfiguration]a DispatchActionConfiguration object that
determines when during text input the element returns a
block_actions payload.
focus_on_loadboolwhether or not the menu will be set to autofocus
within the view object.
placeholderOptional[TextLike]a plain-text Text object (max 150 chars) that shows
in the input when it's initially rendered.

Errors

ErrorWhen
InvalidUsageErrorif any of the provided arguments fail validation.

OverflowMenu

Class

OverflowMenu(action_id: str, options: Union[Option, List[Option]], confirm: ConfirmationDialogue = None)

Context menu for additional options (think '...').

See https://api.slack.com/reference/block-kit/block-elements#overflow.

Arguments

ArgumentTypeDescription
action_idstran identifier so the source of the action can be known.
optionsUnion[Option, List[Option]]a list of
Option objects that will form
the content of the overflow menu.
confirmConfirmationDialoguea ConfirmationDialogue object that will be presented when an
option in the overflow menu is selected.

Errors

ErrorWhen
InvalidUsageErrorif any of the provided arguments fail validation.

PlainTextInput

Class

PlainTextInput(action_id: str, initial_value: Optional[str] = None, multiline: bool = False, min_length: Optional[int] = None, max_length: Optional[int] = None, dispatch_action_config: Optional[DispatchActionConfiguration] = None, focus_on_load: bool = False, placeholder: Optional[TextLike] = None)

A plain-text input, similar to the HTML <input> tag, creates a field where a user can enter freeform data. It can appear as a single-line field or a larger text area using the multiline flag.

See: https://api.slack.com/reference/block-kit/block-elements#input.

Arguments

ArgumentTypeDescription
action_idstran identifier so the source of the action can be known.
initial_valueOptional[str]the initial value in the plain-text input when it is loaded.
multilineboolwhether to accept multiple lines of input(defaults to false).
min_lengthOptional[int]minimum number of characters to accept as input.
max_lengthOptional[int]maximum number of characters to accept as input.
dispatch_action_configOptional[DispatchActionConfiguration]a DispatchActionConfiguration object that
determines when during text input the element returns a
block_actions payload.
focus_on_loadboolwhether or not the input will be set to autofocus
within the view object.
placeholderOptional[TextLike]a plain-text Text object (max 150 chars) that shows
in the input when it's initially rendered.

Errors

ErrorWhen
InvalidUsageErrorif any of the provided arguments fail validation.

RadioButtonGroup

Class

RadioButtonGroup(action_id: str, options: List[Option], initial_option: Optional[Option] = None, confirm: Optional[ConfirmationDialogue] = None, focus_on_load: bool = False)

A radio button group that allows a user to choose one item from a list of possible options.

See: https://api.slack.com/reference/block-kit/block-elements#radio.

Arguments

ArgumentTypeDescription
action_idstran identifier so the source of the action can be known.
optionsList[Option]a list of
Option objects that will form
the content of the radio button group.
initial_optionOptional[Option]an
Option object that will be
initially selected when first presented to the user.
confirmOptional[ConfirmationDialogue]a ConfirmationDialogue object that will be presented when an
option in the overflow menu is selected.
focus_on_loadboolwhether or not the input will be set to autofocus
within the view object.

Errors

ErrorWhen
InvalidUsageErrorif any of the provided arguments fail validation.

RichTextInput

Class

RichTextInput(action_id: str, initial_value: Optional[RichText] = None, dispatch_action_config: Optional[DispatchActionConfiguration] = None, focus_on_load: bool = False, placeholder: Optional[TextLike] = None)

Allows users to enter formatted text in a WYSIWYG editor, similar to the Slack messaging experience.

See: https://api.slack.com/reference/block-kit/block-elements#rich_text_input.

Arguments

ArgumentTypeDescription
action_idstran identifier so the source of the action can be known.
initial_valueOptional[RichText]The initial value in the rich text input when it is loaded.
dispatch_action_configOptional[DispatchActionConfiguration]a DispatchActionConfiguration object that
determines when during text input the element returns a
block_actions payload.
focus_on_loadboolwhether or not the menu will be set to autofocus
within the view object.
placeholderOptional[TextLike]a plain-text Text object (max 150 chars) that shows
in the menu when it's initially rendered.

Errors

ErrorWhen
InvalidUsageErrorif any of the provided arguments fail validation.

StaticMultiSelectMenu

Class

StaticMultiSelectMenu(action_id: str, options: Union[Option, List[Option]], option_groups: List[OptionGroup] = None, initial_options: Optional[Union[Option, List[Option], OptionGroup, List[OptionGroup]]] = None, confirm: ConfirmationDialogue = None, max_selected_items: Optional[int] = None, focus_on_load: bool = False, placeholder: Optional[TextLike] = None)

The most basic form of select menu containing a static list of options passed in when defining the element.

See: https://api.slack.com/reference/block-kit/block-elements#static_multi_select.

Arguments

ArgumentTypeDescription
action_idstran identifier so the source of the action can be known.
optionsUnion[Option, List[Option]]a list of Options
(max 100). Only one of options or option_groups must be
provided.
option_groupsList[OptionGroup]a list of
OptionGroups
(max 100). Only one of options or option_groups can be
provided.
initial_optionsOptional[Union[Option, List[Option], OptionGroup, List[OptionGroup]]]the Options
to be intially selected when the element is first rendered.
confirmConfirmationDialoguea ConfirmationDialogue object that will be presented when
the menu is used.
max_selected_itemsOptional[int]the
focus_on_loadboolwhether or not the menu will be set to autofocus
within the view object.
placeholderOptional[TextLike]a plain-text Text object (max 150 chars) that shows
in the menu when it's initially rendered.

Errors

ErrorWhen
InvalidUsageErrorif any of the provided arguments fail validation.

StaticSelectMenu

Class

StaticSelectMenu(action_id: str, options: List[Option] = None, option_groups: List[OptionGroup] = None, initial_option: Optional[Union[Option, OptionGroup]] = None, confirm: Optional[ConfirmationDialogue] = None, focus_on_load: bool = False, placeholder: Optional[TextLike] = None)

A simple select menu interactive UI element, with a static list of options passed in when defining the element.

See: https://api.slack.com/reference/block-kit/block-elements#static_select.

Arguments

ArgumentTypeDescription
action_idstran identifier so the source of the action can be known.
optionsList[Option]a list of
Option objects that will form
the content of the menu (max 100).
option_groupsList[OptionGroup]a list of
OptionGroups
(max 100). Only one of options or option_groups can be
provided.
initial_optionOptional[Union[Option, OptionGroup]]an
Option object that will be
initially selected when first presented to the user.
confirmOptional[ConfirmationDialogue]a ConfirmationDialogue object that will be presented when an
option in the overflow menu is selected.
focus_on_loadboolwhether or not the input will be set to autofocus
within the view object.
placeholderOptional[TextLike]a plain-text Text object (max 150 chars) that shows
in the input when it's initially rendered.

Errors

ErrorWhen
InvalidUsageErrorif any of the provided arguments fail validation.

TimePicker

Class

TimePicker(action_id: str, initial_time: Optional[str] = None, confirm: Optional[ConfirmationDialogue] = None, focus_on_load: bool = False, placeholder: Optional[TextLike] = None, timezone: Optional[str] = None)

An interactive UI element that allows users to select a time of day.

See: https://api.slack.com/reference/block-kit/block-elements#timepicker.

Arguments

ArgumentTypeDescription
action_idstran identifier so the source of the action can be known.
initial_timeOptional[str]
confirmOptional[ConfirmationDialogue]a ConfirmationDialogue object that will be presented when
the input field is used.
focus_on_loadboolwhether or not the menu will be set to autofocus
within the view object.
placeholderOptional[TextLike]a plain-text Text object (max 150 chars) that shows
in the menu when it's initially rendered.
timezoneOptional[str]a string in the IANA format, e.g. "America/Chicago".

Errors

ErrorWhen
InvalidUsageErrorif any of the provided arguments fail validation.

URLInput

Class

URLInput(action_id: str, initial_value: Optional[str] = None, dispatch_action_config: Optional[DispatchActionConfiguration] = None, focus_on_load: bool = False, placeholder: Optional[TextLike] = None)

An interactive UI element for collecting URL input from users.

See: https://api.slack.com/reference/block-kit/block-elements#url.

Arguments

ArgumentTypeDescription
action_idstran identifier so the source of the action can be known.
initial_valueOptional[str]the text to populate the input field with when it
is first rendered.
dispatch_action_configOptional[DispatchActionConfiguration]a DispatchActionConfiguration object that
determines when during text input the element returns a
block_actions payload.
focus_on_loadboolwhether or not the menu will be set to autofocus
within the view object.
placeholderOptional[TextLike]a plain-text Text object (max 150 chars) that shows
in the input when it's initially rendered.

Errors

ErrorWhen
InvalidUsageErrorif any of the provided arguments fail validation.

UserMultiSelectMenu

Class

UserMultiSelectMenu(action_id: str, initial_users: Optional[List[str]] = None, confirm: ConfirmationDialogue = None, max_selected_items: Optional[int] = None, focus_on_load: bool = False, placeholder: Optional[TextLike] = None)

This interactive UI element allows users to select multiple users visible to the current user in the active workspace.

See: https://api.slack.com/reference/block-kit/block-elements#users_multi_select.

Arguments

ArgumentTypeDescription
action_idstran identifier so the source of the action can be known.
initial_usersOptional[List[str]]a list of string user IDs to be intially selected
when the element is first rendered.
confirmConfirmationDialoguea ConfirmationDialogue object that will be presented when
the menu is used.
max_selected_itemsOptional[int]the highest number of items from the list that
can be selected at one time.
focus_on_loadboolwhether or not the menu will be set to autofocus
within the view object.
placeholderOptional[TextLike]a plain-text Text object (max 150 chars) that shows
in the menu when it's initially rendered.

Errors

ErrorWhen
InvalidUsageErrorif any of the provided arguments fail validation.

UserSelectMenu

Class

UserSelectMenu(action_id: str, initial_user: Optional[str] = None, confirm: Optional[ConfirmationDialogue] = None, focus_on_load: bool = False, placeholder: Optional[TextLike] = None)

A select menu interactive UI element, sourced automatically with Slack users from the current workspace visible to the current user.

See: https://api.slack.com/reference/block-kit/block-elements#users_select.

Arguments

ArgumentTypeDescription
action_idstran identifier so the source of the action can be known.
initial_userOptional[str]the single (string) user ID that will be initially selected
when first presented to the user.
confirmOptional[ConfirmationDialogue]a ConfirmationDialogue object that will be presented when an
option in the overflow menu is selected.
focus_on_loadboolwhether or not the input will be set to autofocus
within the view object.
placeholderOptional[TextLike]a plain-text Text object (max 150 chars) that shows
in the input when it's initially rendered.

Errors

ErrorWhen
InvalidUsageErrorif any of the provided arguments fail validation.

WorkflowButton

Class

WorkflowButton(text: TextLike, workflow: Optional[Workflow] = None, style: Optional[ButtonStyleLike] = ButtonStyle.DEFAULT, accessibility_label: Optional[str] = None)

An interactive component that allows users to run a link trigger with customizable inputs.

See: https://api.slack.com/reference/block-kit/block-elements#workflow_button.

Arguments

ArgumentTypeDescription
textTextLikethe text content that will appear in the button.
workflowOptional[Workflow]a Workflow object
that contains details about the workflow that will run when the
button is clicked.
styleOptional[ButtonStyleLike]one of Default, Primary, or Danger, determines the
visual style of the button. Consider using the ButtonStyle
object for this.
accessibility_labelOptional[str]a string label for longer descriptive text about
a button element. Used by screen readers (max 75 chars).

Errors

ErrorWhen
InvalidUsageErrorif any of the provided arguments fail validation.