Skip to main content

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

ArgumentTypeDescription
textTextLiketext on the button (plaintext only; max 75 chars).
action_idstran identifier so the source of the action can be known.
urlstr | Nonea URL to load in the user's browser when the button is clicked.
valuestr | Nonethe value sent with the interaction payload.
styleButtonStyle | ButtonStyleName | Nonethe visual style of the button, one of primary, danger.
confirmConfirmationDialogue | Nonea ConfirmationDialogue object that will be presented when
the button is clicked.
accessibility_labelstr | Nonea 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

ArgumentTypeDescription
action_idstran identifier so the source of the action can be known.
initial_channelslist[str] | Nonea list of conversation IDs as strings that will
already be selected when the menu renders.
confirmConfirmationDialogue | Nonea ConfirmationDialogue object that will be presented when
the menu is used.
max_selected_itemsint | Nonethe 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.
placeholderTextLike | Nonea 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: '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

ArgumentTypeDescription
action_idstran identifier so the source of the action can be known.
initial_channelstr | Nonethe single (string) user ID that will be initially selected
when first presented to the user.
confirmConfirmationDialogue | Nonea ConfirmationDialogue object that will be presented when an
option in the overflow menu is selected.
response_url_enabledbool | NoneWhen 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.
placeholderTextLike | Nonea 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: '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

ArgumentTypeDescription
action_idstran identifier so the source of the action can be known.
optionsOption | list[Option]a list of
Option objects that will form
the content of the checkbox group.
initial_optionsOption | list[Option] | Nonea list of
Option objects that will be
initially selected when first presented to the user.
confirmConfirmationDialogue | Nonea 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: '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

ArgumentTypeDescription
action_idstran identifier so the source of the action can be known.
initial_conversationslist[str] | Nonea list of conversation IDs as strings that will
already be selected when the menu renders.
default_to_current_conversationbool | NonePre-populates the select menu with the
conversation that the user was viewing when they opened the modal
(defaults to False).
confirmConfirmationDialogue | Nonea ConfirmationDialogue object that will be presented when
the menu is used.
max_selected_itemsint | Nonethe maximum number of items that can be selected
in the menu.
filterConversationFilter | Nonea Filter
object that filters out conversations that don't match the settings
of the filter.
focus_on_loadbool | Nonewhether or not the menu will be set to autofocus
within the view object.
placeholderTextLike | Nonea 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: '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

ArgumentTypeDescription
action_idstran identifier so the source of the action can be known.
initial_conversationstr | Nonethe single (string) conversation ID that will be initially
selected when first presented to the user.
default_to_current_conversationbool | NonePre-populates the select menu with the
conversation that the user was viewing when they opened the modal
(defaults to False).
confirmConfirmationDialogue | Nonea ConfirmationDialogue object that will be presented when an
option in the overflow menu is selected.
response_url_enabledbool | NoneWhen 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).
filterConversationFilter | Nonea 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.
placeholderTextLike | Nonea 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: '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

ArgumentTypeDescription
action_idstran identifier so the source of the action can be known.
initial_datestr | Nonethe date (in YYYY-MM-DD format) that will appear on the
picker when it first renders.
confirmConfirmationDialogue | Nonea 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.
placeholderTextLike | Nonea 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: '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

ArgumentTypeDescription
action_idstran identifier so the source of the action can be known.
initial_datetimeint | Nonethe initial value the date-time picker will be set to
when it first renders.
confirmConfirmationDialogue | Nonea 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.

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

ArgumentTypeDescription
action_idstran identifier so the source of the action can be known.
initial_valuestr | NoneThe initial value in the email input when it is loaded.
dispatch_action_configDispatchActionConfiguration | Nonea 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.
placeholderTextLike | Nonea 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: '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

ArgumentTypeDescription
action_idstran identifier so the source of the action can be known.
min_query_lengthint | Noneminimum number of characters entered before the query
is dispactched (defaults to 3 if not provided).
initial_optionsOption | list[Option] | OptionGroup | list[OptionGroup] | Nonethe Options
to be initially selected when the element is first rendered.
confirmConfirmationDialogue | Nonea ConfirmationDialogue object that will be presented when
the menu is used.
max_selected_itemsint | Nonethe 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.
placeholderTextLike | Nonea 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: '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

ArgumentTypeDescription
action_idstran identifier so the source of the action can be known.
initial_optionOption | OptionGroup | Nonean
Option object that will be
initially selected when first presented to the user.
min_query_lengthint | Noneminimum number of characters entered before the query
is dispactched (defaults to 3 if not provided).
confirmConfirmationDialogue | Nonea 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.
placeholderTextLike | Nonea 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.

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

ArgumentTypeDescription
textTextLikethe text on the button (plaintext only; max 75 chars).
valuestrthe value sent with the interaction payload (max 2000 chars).
accessibility_labelstr | Nonea string label for longer descriptive text about
the button. Used by screen readers (max 75 chars).

Errors

ErrorWhen
InvalidUsageErrorif 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

ArgumentTypeDescription
positive_buttonFeedbackButtona FeedbackButton used to indicate positive feedback.
negative_buttonFeedbackButtona FeedbackButton used to indicate negative feedback.
action_idstr | Nonean identifier so the source of the action can be known.

Errors

ErrorWhen
InvalidUsageErrorif 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

ArgumentTypeDescription
action_idstr | Nonean identifier so the source of the action can be known.
filetypesstr | list[str] | Nonea list of file extensions (as strings) that will be accepted
for upload.
max_filesint | Nonethe maximum number of files that can be uploaded (between 1
and 10).

Errors

ErrorWhen
InvalidUsageErrorif 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

ArgumentTypeDescription
textTextLikethe text describing the button (plaintext only).
iconLiteral['trash']the icon to show; trash is the only icon currently
supported by Slack.
action_idstr | Nonean identifier so the source of the action can be known.
valuestr | Nonethe value sent with the interaction payload (max 2000 chars).
confirmConfirmationDialogue | Nonea ConfirmationDialogue object that will be presented when
the button is clicked.
accessibility_labelstr | Nonea string label for longer descriptive text about
the button. Used by screen readers (max 75 chars).
visible_to_user_idslist[str] | Nonea list of (string) user IDs for which the button
is visible (max 10). If not provided, the button is visible to
all users.

Errors

ErrorWhen
InvalidUsageErrorif 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

ArgumentTypeDescription
alt_textstra plain-text-only summary of the content of the image.
image_urlstr | Nonea URL for a publicly hosted image (the user must provide
either image_url or slack_file).
slack_fileSlackFile | Nonea 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: '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

ArgumentTypeDescription
is_decimal_allowedboolwhether to accept decimal values as input.
action_idstr | Nonean identifier so the source of the action can be known.
initial_valuestr | Nonethe initial value in the number input when it is loaded.
min_valuefloat | int | Noneminimum accepted value for the input field.
max_valuefloat | int | Nonemaximum accepted value for the input field.
dispatch_action_configDispatchActionConfiguration | Nonea 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.
placeholderTextLike | Nonea 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: '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

ArgumentTypeDescription
action_idstran identifier so the source of the action can be known.
optionsOption | list[Option]a list of
Option objects that will form
the content of the overflow menu.
confirmConfirmationDialogue | Nonea 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: '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

ArgumentTypeDescription
action_idstran identifier so the source of the action can be known.
initial_valuestr | Nonethe initial value in the plain-text input when it is loaded.
multilineboolwhether to accept multiple lines of input(defaults to false).
min_lengthint | Noneminimum number of characters to accept as input.
max_lengthint | Nonemaximum number of characters to accept as input.
dispatch_action_configDispatchActionConfiguration | Nonea 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.
placeholderTextLike | Nonea 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: '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

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_optionOption | Nonean
Option object that will be
initially selected when first presented to the user.
confirmConfirmationDialogue | Nonea 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: '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

ArgumentTypeDescription
action_idstran identifier so the source of the action can be known.
initial_valueRichText | NoneThe initial value in the rich text input when it is loaded.
dispatch_action_configDispatchActionConfiguration | Nonea 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.
placeholderTextLike | Nonea 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: '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

ArgumentTypeDescription
action_idstran identifier so the source of the action can be known.
optionsOption | list[Option]a list of Options
(max 100). Only one of options or option_groups must be
provided.
option_groupsOptionGroup | list[OptionGroup] | Nonea list of
OptionGroups
(max 100). Only one of options or option_groups can be
provided.
initial_optionsOption | list[Option] | OptionGroup | list[OptionGroup] | Nonethe Options
to be initially selected when the element is first rendered.
confirmConfirmationDialogue | Nonea ConfirmationDialogue object that will be presented when
the menu is used.
max_selected_itemsint | Nonethe
focus_on_loadboolwhether or not the menu will be set to autofocus
within the view object.
placeholderTextLike | Nonea 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' = 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

ArgumentTypeDescription
action_idstran identifier so the source of the action can be known.
optionslist[Option] | Nonea list of
Option objects that will form
the content of the menu (max 100).
option_groupslist[OptionGroup] | Nonea list of
OptionGroups
(max 100). Only one of options or option_groups can be
provided.
initial_optionOption | OptionGroup | Nonean
Option object that will be
initially selected when first presented to the user.
confirmConfirmationDialogue | Nonea 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.
placeholderTextLike | Nonea 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: '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

ArgumentTypeDescription
action_idstran identifier so the source of the action can be known.
initial_timestr | None
confirmConfirmationDialogue | Nonea 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.
placeholderTextLike | Nonea plain-text Text object (max 150 chars) that shows
in the menu when it's initially rendered.
timezonestr | Nonea 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: '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

ArgumentTypeDescription
action_idstran identifier so the source of the action can be known.
initial_valuestr | Nonethe text to populate the input field with when it
is first rendered.
dispatch_action_configDispatchActionConfiguration | Nonea 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.
placeholderTextLike | Nonea 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.

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

ArgumentTypeDescription
urlstrthe URL of the source (max 3000 chars).
textstrthe label displayed for the source.

Errors

ErrorWhen
InvalidUsageErrorif 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

ArgumentTypeDescription
action_idstran identifier so the source of the action can be known.
initial_userslist[str] | Nonea list of string user IDs to be initially selected
when the element is first rendered.
confirmConfirmationDialogue | Nonea ConfirmationDialogue object that will be presented when
the menu is used.
max_selected_itemsint | Nonethe 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.
placeholderTextLike | Nonea 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: '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

ArgumentTypeDescription
action_idstran identifier so the source of the action can be known.
initial_userstr | Nonethe single (string) user ID that will be initially selected
when first presented to the user.
confirmConfirmationDialogue | Nonea 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.
placeholderTextLike | Nonea 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: '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

ArgumentTypeDescription
textTextLikethe text content that will appear in the button.
workflowWorkflow | Nonea Workflow object
that contains details about the workflow that will run when the
button is clicked.
styleButtonStyleLike | Noneone of Default, Primary, or Danger, determines the
visual style of the button. Consider using the ButtonStyle
object for this.
accessibility_labelstr | Nonea 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.