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
| Argument | Type | Description |
|---|---|---|
text | TextLike | text on the button (plaintext only; max 75 chars). |
action_id | str | an identifier so the source of the action can be known. |
url | Optional[str] | a URL to load in the user's browser when the button is clicked. |
value | Optional[str] | the value sent with the interaction payload. |
style | Optional[str] | the visual style of the button, one of primary, danger. |
confirm | Optional[ConfirmationDialogue] | a ConfirmationDialogue object that will be presented whenthe button is clicked. |
accessibility_label | Optional[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
| Argument | Type | Description |
|---|---|---|
action_id | str | an identifier so the source of the action can be known. |
initial_channels | Optional[List[str]] | a list of conversation IDs as strings that will already be selected when the menu renders. |
confirm | ConfirmationDialogue | a ConfirmationDialogue object that will be presented whenthe menu is used. |
max_selected_items | Optional[int] | the maximum number of items that can be selected in the menu. |
focus_on_load | bool | whether or not the menu will be set to autofocus within the view object. |
placeholder | Optional[TextLike] | a plain-text Text object (max 150 chars) that showsin the menu when it's initially rendered. |
Errors
| Error | When |
|---|---|
InvalidUsageError | if 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
| Argument | Type | Description |
|---|---|---|
action_id | str | an identifier so the source of the action can be known. |
initial_channel | Optional[str] | the single (string) user ID that will be initially selected when first presented to the user. |
confirm | Optional[ConfirmationDialogue] | a ConfirmationDialogue object that will be presented when anoption in the overflow menu is selected. |
response_url_enabled | Optional[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_load | bool | whether or not the input will be set to autofocus within the view object. |
placeholder | Optional[TextLike] | a plain-text Text object (max 150 chars) that showsin the input when it's initially rendered. |
Errors
| Error | When |
|---|---|
InvalidUsageError | if 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
| Argument | Type | Description |
|---|---|---|
action_id | str | an identifier so the source of the action can be known. |
options | Union[Option, List[Option]] | a list ofOption objects that will formthe content of the checkbox group. |
initial_options | Optional[Union[Option, List[Option]]] | a list ofOption objects that will beinitially selected when first presented to the user. |
confirm | ConfirmationDialogue | a ConfirmationDialogue object that will be presented whenthe checkbox group is used. |
focus_on_load | bool | whether or not the checkbox group will be set to autofocus within the view object. |
Errors
| Error | When |
|---|---|
InvalidUsageError | if 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
| Argument | Type | Description |
|---|---|---|
action_id | str | an identifier so the source of the action can be known. |
initial_conversations | Optional[List[str]] | a list of conversation IDs as strings that will already be selected when the menu renders. |
default_to_current_conversation | Optional[bool] | Pre-populates the select menu with the conversation that the user was viewing when they opened the modal (defaults to False). |
confirm | ConfirmationDialogue | a ConfirmationDialogue object that will be presented whenthe menu is used. |
max_selected_items | Optional[int] | the maximum number of items that can be selected in the menu. |
filter | Optional[ConversationFilter] | a Filterobject that filters out conversations that don't match the settings of the filter. |
focus_on_load | Optional[bool] | whether or not the menu will be set to autofocus within the view object. |
placeholder | Optional[TextLike] | a plain-text Text object (max 150 chars) that showsin the menu when it's initially rendered. |
Errors
| Error | When |
|---|---|
InvalidUsageError | if 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
| Argument | Type | Description |
|---|---|---|
action_id | str | an identifier so the source of the action can be known. |
initial_conversation | Optional[str] | the single (string) coversation ID that will be initially selected when first presented to the user. |
default_to_current_conversation | Optional[bool] | Pre-populates the select menu with the conversation that the user was viewing when they opened the modal (defaults to False). |
confirm | Optional[ConfirmationDialogue] | a ConfirmationDialogue object that will be presented when anoption in the overflow menu is selected. |
response_url_enabled | Optional[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). |
filter | Optional[ConversationFilter] | a Filterobject that filters out conversations that don't match the settings of the filter. |
focus_on_load | bool | whether or not the input will be set to autofocus within the view object. |
placeholder | Optional[TextLike] | a plain-text Text object (max 150 chars) that showsin the input when it's initially rendered. |
Errors
| Error | When |
|---|---|
InvalidUsageError | if 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
| Argument | Type | Description |
|---|---|---|
action_id | str | an identifier so the source of the action can be known. |
initial_date | Optional[str] | the date (in YYYY-MM-DD format) that will appear on thepicker when it first renders. |
confirm | ConfirmationDialogue | a ConfirmationDialogue object that will be presented whenthe date picker is clicked. |
focus_on_load | bool | whether or not the date picker will be set to autofocus within the view object. |
placeholder | Optional[TextLike] | a TextType.PLAINTEXT Text object that defines what textwill initially appear on the picker. |
Errors
| Error | When |
|---|---|
InvalidUsageError | if 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
| Argument | Type | Description |
|---|---|---|
action_id | str | an identifier so the source of the action can be known. |
initial_datetime | Optional[int] | the initial value the date-time picker will be set to when it first renders. |
confirm | ConfirmationDialogue | a ConfirmationDialogue object that will be presented whenthe button is date-time picker is used. |
focus_on_load | bool | whether 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
| Argument | Type | Description |
|---|---|---|
action_id | str | an identifier so the source of the action can be known. |
initial_value | Optional[str] | The initial value in the email input when it is loaded. |
dispatch_action_config | Optional[DispatchActionConfiguration] | a DispatchActionConfiguration object thatdetermines when during text input the element returns a block_actions payload. |
focus_on_load | bool | whether or not the email input will be set to autofocus within the view object. |
placeholder | Optional[TextLike] | a TextType.PLAINTEXT Text object that defines what textwill initially appear in the input field. |
Errors
| Error | When |
|---|---|
InvalidUsageError | if 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
| Argument | Type | Description |
|---|---|---|
action_id | str | an identifier so the source of the action can be known. |
min_query_length | Optional[int] | minimum number of characters entered before the query is dispactched (defaults to 3 if not provided). |
initial_options | Optional[Union[Option, List[Option], OptionGroup, List[OptionGroup]]] | the Optionsto be intially selected when the element is first rendered. |
confirm | ConfirmationDialogue | a ConfirmationDialogue object that will be presented whenthe menu is used. |
max_selected_items | Optional[int] | the highest number of items from the list that can be selected at one time. |
focus_on_load | bool | whether or not the menu will be set to autofocus within the view object. |
placeholder | Optional[TextLike] | a plain-text Text object (max 150 chars) that showsin the menu when it's initially rendered. |
Errors
| Error | When |
|---|---|
InvalidUsageError | if 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
| Argument | Type | Description |
|---|---|---|
action_id | str | an identifier so the source of the action can be known. |
initial_option | Union[Option, OptionGroup] | anOption object that will beinitially selected when first presented to the user. |
min_query_length | Optional[int] | minimum number of characters entered before the query is dispactched (defaults to 3 if not provided). |
confirm | Optional[ConfirmationDialogue] | a ConfirmationDialogue object that will be presented when anoption in the overflow menu is selected. |
focus_on_load | bool | whether or not the input will be set to autofocus within the view object. |
placeholder | Optional[TextLike] | a plain-text Text object (max 150 chars) that showsin the input when it's initially rendered. |
Errors
| Error | When |
|---|---|
InvalidUsageError | if 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
| Argument | Type | Description |
|---|---|---|
action_id | Optional[str] | an identifier so the source of the action can be known. |
filetypes | Optional[Union[str, List[str]]] | a list of file extensions (as strings) that will be accepted for upload. |
max_files | Optional[int] | the maximum number of files that can be uploaded (between 1 and 10). |
Errors
| Error | When |
|---|---|
InvalidUsageError | if 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
| Argument | Type | Description |
|---|---|---|
alt_text | str | a plain-text-only summary of the content of the image. |
image_url | Optional[str] | a URL for a publicly hosted image (the user must provide either image_url or slack_file). |
slack_file | Optional[SlackFile] | a SlackFile(the user must provide either image_url or slack_file). |
Errors
| Error | When |
|---|---|
InvalidUsageError | if 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
| Argument | Type | Description |
|---|---|---|
is_decimal_allowed | bool | whether to accept decimal values as input. |
action_id | Optional[str] | an identifier so the source of the action can be known. |
initial_value | Optional[str] | the initial value in the number input when it is loaded. |
min_value | Optional[Union[float, int]] | minimum accepted value for the input field. |
max_value | Optional[Union[float, int]] | maximum accepted value for the input field. |
dispatch_action_config | Optional[DispatchActionConfiguration] | a DispatchActionConfiguration object thatdetermines when during text input the element returns a block_actions payload. |
focus_on_load | bool | whether or not the menu will be set to autofocus within the view object. |
placeholder | Optional[TextLike] | a plain-text Text object (max 150 chars) that showsin the input when it's initially rendered. |
Errors
| Error | When |
|---|---|
InvalidUsageError | if 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
| Argument | Type | Description |
|---|---|---|
action_id | str | an identifier so the source of the action can be known. |
options | Union[Option, List[Option]] | a list ofOption objects that will formthe content of the overflow menu. |
confirm | ConfirmationDialogue | a ConfirmationDialogue object that will be presented when anoption in the overflow menu is selected. |
Errors
| Error | When |
|---|---|
InvalidUsageError | if 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
| Argument | Type | Description |
|---|---|---|
action_id | str | an identifier so the source of the action can be known. |
initial_value | Optional[str] | the initial value in the plain-text input when it is loaded. |
multiline | bool | whether to accept multiple lines of input(defaults to false). |
min_length | Optional[int] | minimum number of characters to accept as input. |
max_length | Optional[int] | maximum number of characters to accept as input. |
dispatch_action_config | Optional[DispatchActionConfiguration] | a DispatchActionConfiguration object thatdetermines when during text input the element returns a block_actions payload. |
focus_on_load | bool | whether or not the input will be set to autofocus within the view object. |
placeholder | Optional[TextLike] | a plain-text Text object (max 150 chars) that showsin the input when it's initially rendered. |
Errors
| Error | When |
|---|---|
InvalidUsageError | if 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
| Argument | Type | Description |
|---|---|---|
action_id | str | an identifier so the source of the action can be known. |
options | List[Option] | a list ofOption objects that will formthe content of the radio button group. |
initial_option | Optional[Option] | anOption object that will beinitially selected when first presented to the user. |
confirm | Optional[ConfirmationDialogue] | a ConfirmationDialogue object that will be presented when anoption in the overflow menu is selected. |
focus_on_load | bool | whether or not the input will be set to autofocus within the view object. |
Errors
| Error | When |
|---|---|
InvalidUsageError | if 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
| Argument | Type | Description |
|---|---|---|
action_id | str | an identifier so the source of the action can be known. |
initial_value | Optional[RichText] | The initial value in the rich text input when it is loaded. |
dispatch_action_config | Optional[DispatchActionConfiguration] | a DispatchActionConfiguration object thatdetermines when during text input the element returns a block_actions payload. |
focus_on_load | bool | whether or not the menu will be set to autofocus within the view object. |
placeholder | Optional[TextLike] | a plain-text Text object (max 150 chars) that showsin the menu when it's initially rendered. |
Errors
| Error | When |
|---|---|
InvalidUsageError | if 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
| Argument | Type | Description |
|---|---|---|
action_id | str | an identifier so the source of the action can be known. |
options | Union[Option, List[Option]] | a list of Options(max 100). Only one of options or option_groups must beprovided. |
option_groups | List[OptionGroup] | a list ofOptionGroups(max 100). Only one of options or option_groups can beprovided. |
initial_options | Optional[Union[Option, List[Option], OptionGroup, List[OptionGroup]]] | the Optionsto be intially selected when the element is first rendered. |
confirm | ConfirmationDialogue | a ConfirmationDialogue object that will be presented whenthe menu is used. |
max_selected_items | Optional[int] | the |
focus_on_load | bool | whether or not the menu will be set to autofocus within the view object. |
placeholder | Optional[TextLike] | a plain-text Text object (max 150 chars) that showsin the menu when it's initially rendered. |
Errors
| Error | When |
|---|---|
InvalidUsageError | if 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
| Argument | Type | Description |
|---|---|---|
action_id | str | an identifier so the source of the action can be known. |
options | List[Option] | a list ofOption objects that will formthe content of the menu (max 100). |
option_groups | List[OptionGroup] | a list ofOptionGroups(max 100). Only one of options or option_groups can beprovided. |
initial_option | Optional[Union[Option, OptionGroup]] | anOption object that will beinitially selected when first presented to the user. |
confirm | Optional[ConfirmationDialogue] | a ConfirmationDialogue object that will be presented when anoption in the overflow menu is selected. |
focus_on_load | bool | whether or not the input will be set to autofocus within the view object. |
placeholder | Optional[TextLike] | a plain-text Text object (max 150 chars) that showsin the input when it's initially rendered. |
Errors
| Error | When |
|---|---|
InvalidUsageError | if 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
| Argument | Type | Description |
|---|---|---|
action_id | str | an identifier so the source of the action can be known. |
initial_time | Optional[str] | — |
confirm | Optional[ConfirmationDialogue] | a ConfirmationDialogue object that will be presented whenthe input field is used. |
focus_on_load | bool | whether or not the menu will be set to autofocus within the view object. |
placeholder | Optional[TextLike] | a plain-text Text object (max 150 chars) that showsin the menu when it's initially rendered. |
timezone | Optional[str] | a string in the IANA format, e.g. "America/Chicago". |
Errors
| Error | When |
|---|---|
InvalidUsageError | if 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
| Argument | Type | Description |
|---|---|---|
action_id | str | an identifier so the source of the action can be known. |
initial_value | Optional[str] | the text to populate the input field with when it is first rendered. |
dispatch_action_config | Optional[DispatchActionConfiguration] | a DispatchActionConfiguration object thatdetermines when during text input the element returns a block_actions payload. |
focus_on_load | bool | whether or not the menu will be set to autofocus within the view object. |
placeholder | Optional[TextLike] | a plain-text Text object (max 150 chars) that showsin the input when it's initially rendered. |
Errors
| Error | When |
|---|---|
InvalidUsageError | if 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
| Argument | Type | Description |
|---|---|---|
action_id | str | an identifier so the source of the action can be known. |
initial_users | Optional[List[str]] | a list of string user IDs to be intially selected when the element is first rendered. |
confirm | ConfirmationDialogue | a ConfirmationDialogue object that will be presented whenthe menu is used. |
max_selected_items | Optional[int] | the highest number of items from the list that can be selected at one time. |
focus_on_load | bool | whether or not the menu will be set to autofocus within the view object. |
placeholder | Optional[TextLike] | a plain-text Text object (max 150 chars) that showsin the menu when it's initially rendered. |
Errors
| Error | When |
|---|---|
InvalidUsageError | if 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
| Argument | Type | Description |
|---|---|---|
action_id | str | an identifier so the source of the action can be known. |
initial_user | Optional[str] | the single (string) user ID that will be initially selected when first presented to the user. |
confirm | Optional[ConfirmationDialogue] | a ConfirmationDialogue object that will be presented when anoption in the overflow menu is selected. |
focus_on_load | bool | whether or not the input will be set to autofocus within the view object. |
placeholder | Optional[TextLike] | a plain-text Text object (max 150 chars) that showsin the input when it's initially rendered. |
Errors
| Error | When |
|---|---|
InvalidUsageError | if 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
| Argument | Type | Description |
|---|---|---|
text | TextLike | the text content that will appear in the button. |
workflow | Optional[Workflow] | a Workflow objectthat contains details about the workflow that will run when the button is clicked. |
style | Optional[ButtonStyleLike] | one of Default, Primary, or Danger, determines thevisual style of the button. Consider using the ButtonStyleobject for this. |
accessibility_label | Optional[str] | a string label for longer descriptive text about a button element. Used by screen readers (max 75 chars). |
Errors
| Error | When |
|---|---|
InvalidUsageError | if any of the provided arguments fail validation. |