Elements
Button
Class
Button(text: 'TextLike', action_id: 'str', url: 'str | None' = None, value: 'str | None' = None, style: 'ButtonStyle | ButtonStyleName | None' = None, confirm: 'ConfirmationDialogue | None' = None, accessibility_label: 'str | None' = None) -> '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 | str | None | a URL to load in the user's browser when the button is clicked. |
value | str | None | the value sent with the interaction payload. |
style | ButtonStyle | ButtonStyleName | None | the visual style of the button, one of primary, danger. |
confirm | ConfirmationDialogue | None | a ConfirmationDialogue object that will be presented whenthe button is clicked. |
accessibility_label | str | None | 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.
ChannelMultiSelectMenu
Class
ChannelMultiSelectMenu(action_id: 'str', initial_channels: 'list[str] | None' = None, confirm: 'ConfirmationDialogue | None' = None, max_selected_items: 'int | None' = None, focus_on_load: 'bool' = False, placeholder: 'TextLike | None' = None) -> '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 | list[str] | None | a list of conversation IDs as strings that will already be selected when the menu renders. |
confirm | ConfirmationDialogue | None | a ConfirmationDialogue object that will be presented whenthe menu is used. |
max_selected_items | int | None | 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 | TextLike | None | 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: 'str | None' = None, confirm: 'ConfirmationDialogue | None' = None, response_url_enabled: 'bool | None' = False, focus_on_load: 'bool' = False, placeholder: 'TextLike | None' = None) -> '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 | str | None | the single (string) user ID that will be initially selected when first presented to the user. |
confirm | ConfirmationDialogue | None | a ConfirmationDialogue object that will be presented when anoption in the overflow menu is selected. |
response_url_enabled | bool | None | 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 | TextLike | None | 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: 'Option | list[Option]', initial_options: 'Option | list[Option] | None' = None, confirm: 'ConfirmationDialogue | None' = None, focus_on_load: 'bool' = False) -> 'None'
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 | Option | list[Option] | a list ofOption objects that will formthe content of the checkbox group. |
initial_options | Option | list[Option] | None | a list ofOption objects that will beinitially selected when first presented to the user. |
confirm | ConfirmationDialogue | None | 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: 'list[str] | None' = None, default_to_current_conversation: 'bool | None' = False, confirm: 'ConfirmationDialogue | None' = None, max_selected_items: 'int | None' = None, filter: 'ConversationFilter | None' = None, focus_on_load: 'bool | None' = False, placeholder: 'TextLike | None' = None) -> '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 | list[str] | None | a list of conversation IDs as strings that will already be selected when the menu renders. |
default_to_current_conversation | bool | None | Pre-populates the select menu with the conversation that the user was viewing when they opened the modal (defaults to False). |
confirm | ConfirmationDialogue | None | a ConfirmationDialogue object that will be presented whenthe menu is used. |
max_selected_items | int | None | the maximum number of items that can be selected in the menu. |
filter | ConversationFilter | None | a Filterobject that filters out conversations that don't match the settings of the filter. |
focus_on_load | bool | None | whether or not the menu will be set to autofocus within the view object. |
placeholder | TextLike | None | 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: 'str | None' = None, default_to_current_conversation: 'bool | None' = False, confirm: 'ConfirmationDialogue | None' = None, response_url_enabled: 'bool | None' = False, filter: 'ConversationFilter | None' = None, focus_on_load: 'bool' = False, placeholder: 'TextLike | None' = None) -> '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 | str | None | the single (string) conversation ID that will be initially selected when first presented to the user. |
default_to_current_conversation | bool | None | Pre-populates the select menu with the conversation that the user was viewing when they opened the modal (defaults to False). |
confirm | ConfirmationDialogue | None | a ConfirmationDialogue object that will be presented when anoption in the overflow menu is selected. |
response_url_enabled | bool | None | 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 | ConversationFilter | None | 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 | TextLike | None | 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: 'str | None' = None, confirm: 'ConfirmationDialogue | None' = None, focus_on_load: 'bool' = False, placeholder: 'TextLike | None' = None) -> '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 | str | None | the date (in YYYY-MM-DD format) that will appear on thepicker when it first renders. |
confirm | ConfirmationDialogue | None | 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 | TextLike | None | 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: 'int | None' = None, confirm: 'ConfirmationDialogue | None' = None, focus_on_load: 'bool' = False) -> 'None'
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 | int | None | the initial value the date-time picker will be set to when it first renders. |
confirm | ConfirmationDialogue | None | 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.
Element
Class
Element(type_: 'ElementType') -> 'None'
Basis element containing attributes and behaviour common to all elements. N.B: Element is an abstract class and cannot be used directly.
EmailInput
Class
EmailInput(action_id: 'str', initial_value: 'str | None' = None, dispatch_action_config: 'DispatchActionConfiguration | None' = None, focus_on_load: 'bool' = False, placeholder: 'TextLike | None' = None) -> '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 | str | None | The initial value in the email input when it is loaded. |
dispatch_action_config | DispatchActionConfiguration | None | 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 | TextLike | None | 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: 'int | None' = None, initial_options: 'Option | list[Option] | OptionGroup | list[OptionGroup] | None' = None, confirm: 'ConfirmationDialogue | None' = None, max_selected_items: 'int | None' = None, focus_on_load: 'bool' = False, placeholder: 'TextLike | None' = None) -> '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 | int | None | minimum number of characters entered before the query is dispactched (defaults to 3 if not provided). |
initial_options | Option | list[Option] | OptionGroup | list[OptionGroup] | None | the Optionsto be initially selected when the element is first rendered. |
confirm | ConfirmationDialogue | None | a ConfirmationDialogue object that will be presented whenthe menu is used. |
max_selected_items | int | None | 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 | TextLike | None | 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: 'Option | OptionGroup | None' = None, min_query_length: 'int | None' = None, confirm: 'ConfirmationDialogue | None' = None, focus_on_load: 'bool' = False, placeholder: 'TextLike | None' = None) -> 'None'
A select menu interactive UI element, sourced with externally provided options.
See: https://api.slack.com/slackblocks/latest/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 | Option | OptionGroup | None | anOption object that will beinitially selected when first presented to the user. |
min_query_length | int | None | minimum number of characters entered before the query is dispactched (defaults to 3 if not provided). |
confirm | ConfirmationDialogue | None | 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 | TextLike | None | 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. |
FeedbackButton
Class
FeedbackButton(text: 'TextLike', value: 'str', accessibility_label: 'str | None' = None) -> 'None'
One of the positive or negative buttons in a
FeedbackButtons
element.
See: https://docs.slack.dev/reference/block-kit/block-elements/feedback-buttons-element.
Arguments
| Argument | Type | Description |
|---|---|---|
text | TextLike | the text on the button (plaintext only; max 75 chars). |
value | str | the value sent with the interaction payload (max 2000 chars). |
accessibility_label | str | None | a string label for longer descriptive text about the button. Used by screen readers (max 75 chars). |
Errors
| Error | When |
|---|---|
InvalidUsageError | if any of the provided arguments fail validation. |
FeedbackButtons
Class
FeedbackButtons(positive_button: 'FeedbackButton', negative_button: 'FeedbackButton', action_id: 'str | None' = None) -> 'None'
A paired positive/negative feedback control for a
ContextActionsBlock.
See: https://docs.slack.dev/reference/block-kit/block-elements/feedback-buttons-element.
Arguments
| Argument | Type | Description |
|---|---|---|
positive_button | FeedbackButton | a FeedbackButton used to indicate positive feedback. |
negative_button | FeedbackButton | a FeedbackButton used to indicate negative feedback. |
action_id | str | None | an identifier so the source of the action can be known. |
Errors
| Error | When |
|---|---|
InvalidUsageError | if any of the provided arguments fail validation. |
FileInput
Class
FileInput(action_id: 'str | None' = None, filetypes: 'str | list[str] | None' = None, max_files: 'int | None' = None) -> '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 | str | None | an identifier so the source of the action can be known. |
filetypes | str | list[str] | None | a list of file extensions (as strings) that will be accepted for upload. |
max_files | int | None | 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. |
IconButton
Class
IconButton(text: 'TextLike', icon: "Literal['trash']" = 'trash', action_id: 'str | None' = None, value: 'str | None' = None, confirm: 'ConfirmationDialogue | None' = None, accessibility_label: 'str | None' = None, visible_to_user_ids: 'list[str] | None' = None) -> 'None'
A compact icon-only action for a
ContextActionsBlock.
Slack currently supports only the trash icon.
See: https://docs.slack.dev/reference/block-kit/block-elements/icon-button-element.
Arguments
| Argument | Type | Description |
|---|---|---|
text | TextLike | the text describing the button (plaintext only). |
icon | Literal['trash'] | the icon to show; trash is the only icon currentlysupported by Slack. |
action_id | str | None | an identifier so the source of the action can be known. |
value | str | None | the value sent with the interaction payload (max 2000 chars). |
confirm | ConfirmationDialogue | None | a ConfirmationDialogue object that will be presented whenthe button is clicked. |
accessibility_label | str | None | a string label for longer descriptive text about the button. Used by screen readers (max 75 chars). |
visible_to_user_ids | list[str] | None | a list of (string) user IDs for which the button is visible (max 10). If not provided, the button is visible to all users. |
Errors
| Error | When |
|---|---|
InvalidUsageError | if any of the provided arguments fail validation. |
Image
Class
Image(alt_text: 'str' = ' ', image_url: 'str | None' = None, slack_file: 'SlackFile | None' = None) -> '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 | str | None | a URL for a publicly hosted image (the user must provide either image_url or slack_file). |
slack_file | SlackFile | None | 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: 'str | None' = None, initial_value: 'str | None' = None, min_value: 'float | int | None' = None, max_value: 'float | int | None' = None, dispatch_action_config: 'DispatchActionConfiguration | None' = None, focus_on_load: 'bool' = False, placeholder: 'TextLike | None' = None) -> '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 | str | None | an identifier so the source of the action can be known. |
initial_value | str | None | the initial value in the number input when it is loaded. |
min_value | float | int | None | minimum accepted value for the input field. |
max_value | float | int | None | maximum accepted value for the input field. |
dispatch_action_config | DispatchActionConfiguration | None | 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 | TextLike | None | 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: 'Option | list[Option]', confirm: 'ConfirmationDialogue | None' = None) -> '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 | Option | list[Option] | a list ofOption objects that will formthe content of the overflow menu. |
confirm | ConfirmationDialogue | None | 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: 'str | None' = None, multiline: 'bool' = False, min_length: 'int | None' = None, max_length: 'int | None' = None, dispatch_action_config: 'DispatchActionConfiguration | None' = None, focus_on_load: 'bool' = False, placeholder: 'TextLike | None' = None) -> '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 | str | None | 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 | int | None | minimum number of characters to accept as input. |
max_length | int | None | maximum number of characters to accept as input. |
dispatch_action_config | DispatchActionConfiguration | None | 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 | TextLike | None | 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: 'Option | None' = None, confirm: 'ConfirmationDialogue | None' = None, focus_on_load: 'bool' = False) -> 'None'
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 | Option | None | anOption object that will beinitially selected when first presented to the user. |
confirm | ConfirmationDialogue | None | 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: 'RichText | None' = None, dispatch_action_config: 'DispatchActionConfiguration | None' = None, focus_on_load: 'bool' = False, placeholder: 'TextLike | None' = None) -> '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 | RichText | None | The initial value in the rich text input when it is loaded. |
dispatch_action_config | DispatchActionConfiguration | None | 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 | TextLike | None | 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: 'Option | list[Option]', option_groups: 'OptionGroup | list[OptionGroup] | None' = None, initial_options: 'Option | list[Option] | OptionGroup | list[OptionGroup] | None' = None, confirm: 'ConfirmationDialogue | None' = None, max_selected_items: 'int | None' = None, focus_on_load: 'bool' = False, placeholder: 'TextLike | None' = None) -> '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 | Option | list[Option] | a list of Options(max 100). Only one of options or option_groups must beprovided. |
option_groups | OptionGroup | list[OptionGroup] | None | a list ofOptionGroups(max 100). Only one of options or option_groups can beprovided. |
initial_options | Option | list[Option] | OptionGroup | list[OptionGroup] | None | the Optionsto be initially selected when the element is first rendered. |
confirm | ConfirmationDialogue | None | a ConfirmationDialogue object that will be presented whenthe menu is used. |
max_selected_items | int | None | the |
focus_on_load | bool | whether or not the menu will be set to autofocus within the view object. |
placeholder | TextLike | None | 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' = None, option_groups: 'list[OptionGroup] | None' = None, initial_option: 'Option | OptionGroup | None' = None, confirm: 'ConfirmationDialogue | None' = None, focus_on_load: 'bool' = False, placeholder: 'TextLike | None' = None) -> '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] | None | a list ofOption objects that will formthe content of the menu (max 100). |
option_groups | list[OptionGroup] | None | a list ofOptionGroups(max 100). Only one of options or option_groups can beprovided. |
initial_option | Option | OptionGroup | None | anOption object that will beinitially selected when first presented to the user. |
confirm | ConfirmationDialogue | None | 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 | TextLike | None | 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: 'str | None' = None, confirm: 'ConfirmationDialogue | None' = None, focus_on_load: 'bool' = False, placeholder: 'TextLike | None' = None, timezone: 'str | None' = None) -> '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 | str | None | — |
confirm | ConfirmationDialogue | None | 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 | TextLike | None | a plain-text Text object (max 150 chars) that showsin the menu when it's initially rendered. |
timezone | str | None | 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: 'str | None' = None, dispatch_action_config: 'DispatchActionConfiguration | None' = None, focus_on_load: 'bool' = False, placeholder: 'TextLike | None' = None) -> '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 | str | None | the text to populate the input field with when it is first rendered. |
dispatch_action_config | DispatchActionConfiguration | None | 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 | TextLike | None | 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. |
URLSource
Class
URLSource(url: 'str', text: 'str') -> 'None'
A labelled URL source displayed by a
TaskCardBlock.
See: https://docs.slack.dev/reference/block-kit/blocks/task-card-block.
Arguments
| Argument | Type | Description |
|---|---|---|
url | str | the URL of the source (max 3000 chars). |
text | str | the label displayed for the source. |
Errors
| Error | When |
|---|---|
InvalidUsageError | if any of the provided arguments fail validation. |
UserMultiSelectMenu
Class
UserMultiSelectMenu(action_id: 'str', initial_users: 'list[str] | None' = None, confirm: 'ConfirmationDialogue | None' = None, max_selected_items: 'int | None' = None, focus_on_load: 'bool' = False, placeholder: 'TextLike | None' = None) -> '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 | list[str] | None | a list of string user IDs to be initially selected when the element is first rendered. |
confirm | ConfirmationDialogue | None | a ConfirmationDialogue object that will be presented whenthe menu is used. |
max_selected_items | int | None | 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 | TextLike | None | 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: 'str | None' = None, confirm: 'ConfirmationDialogue | None' = None, focus_on_load: 'bool' = False, placeholder: 'TextLike | None' = None) -> '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 | str | None | the single (string) user ID that will be initially selected when first presented to the user. |
confirm | ConfirmationDialogue | None | 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 | TextLike | None | 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: 'Workflow | None' = None, style: 'ButtonStyleLike | None' = <ButtonStyle.DEFAULT: None>, accessibility_label: 'str | None' = None) -> '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 | Workflow | None | a Workflow objectthat contains details about the workflow that will run when the button is clicked. |
style | ButtonStyleLike | None | one of Default, Primary, or Danger, determines thevisual style of the button. Consider using the ButtonStyleobject for this. |
accessibility_label | str | None | 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. |