Elements
Generated from actual PHP reflection and PHPDoc. Names live in the Slackblocks namespace. Use named arguments and declare(strict_types=1); values validate before construction returns.
ButtonElement
An interactive button that sends a payload or opens a URL. Readonly properties contain normalized values. See Value for inherited with(), fromArray(), fromJson(), toArray(), toJson() and jsonSerialize().
See the Slack reference.
$text
Sets the button label.
public readonly PlainText $text;
Related types: PlainText
$actionId
Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block.
public readonly ?string $actionId;
$url
Sets a URL opened in the user's browser when the button is clicked. Slack still sends an interaction payload.
public readonly ?string $url;
$value
Sets the application-defined value sent in interaction payloads.
public readonly ?string $value;
$style
Sets the button's emphasis. Omit it for the default neutral style.
public readonly ?ButtonStyle $style;
Related types: ButtonStyle
$confirm
Sets a confirmation dialog shown before the action is sent.
public readonly ?Confirmation $confirm;
Related types: Confirmation
$accessibilityLabel
Sets the label read by screen readers in place of the visible text.
public readonly ?string $accessibilityLabel;
__construct
Construct a validated immutable value.
public function __construct(PlainText|string $text, ?string $actionId = NULL, ?string $url = NULL, ?string $value = NULL, ?ButtonStyle $style = NULL, ?Confirmation $confirm = NULL, ?string $accessibilityLabel = NULL, ?JsonObject $extensions = NULL)
| Parameter | Description |
|---|---|
text | PlainText|string — Sets the button label. |
actionId | string|null — Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block. |
url | string|null — Sets a URL opened in the user's browser when the button is clicked. Slack still sends an interaction payload. |
value | string|null — Sets the application-defined value sent in interaction payloads. |
style | ButtonStyle|null — Sets the button's emphasis. Omit it for the default neutral style. |
confirm | Confirmation|null — Sets a confirmation dialog shown before the action is sent. |
accessibilityLabel | string|null — Sets the label read by screen readers in place of the visible text. |
extensions | JsonObject|null — Additional JSON fields; modeled names and type are reserved. |
| Throws | When |
|---|---|
ValidationError | A content or contextual rule fails. PHP rejects incompatible call signatures with native errors. |
Related types: ButtonStyle, Confirmation, JsonObject, PlainText
ChannelMultiSelectElement
A menu for selecting multiple public channels. Readonly properties contain normalized values. See Value for inherited with(), fromArray(), fromJson(), toArray(), toJson() and jsonSerialize().
See the Slack reference.
$actionId
Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block.
public readonly ?string $actionId;
$initialChannels
Adds channel IDs that are selected when the menu loads.
/** @var list<string>|null */
public readonly ?array $initialChannels;
$confirm
Sets a confirmation dialog shown before the action is sent.
public readonly ?Confirmation $confirm;
Related types: Confirmation
$maxSelectedItems
Sets the maximum number of items a user can select.
public readonly ?int $maxSelectedItems;
$focusOnLoad
Sets whether the element receives focus when the view opens. Only one element per view may do so.
public readonly ?bool $focusOnLoad;
$placeholder
Sets the placeholder text shown before a value is chosen.
public readonly ?PlainText $placeholder;
Related types: PlainText
__construct
Construct a validated immutable value.
public function __construct(?string $actionId = NULL, ?array $initialChannels = NULL, ?Confirmation $confirm = NULL, ?int $maxSelectedItems = NULL, ?bool $focusOnLoad = NULL, PlainText|string|null $placeholder = NULL, ?JsonObject $extensions = NULL)
| Parameter | Description |
|---|---|
actionId | string|null — Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block. |
initialChannels | list<string>|null — Adds channel IDs that are selected when the menu loads. |
confirm | Confirmation|null — Sets a confirmation dialog shown before the action is sent. |
maxSelectedItems | int|null — Sets the maximum number of items a user can select. |
focusOnLoad | bool|null — Sets whether the element receives focus when the view opens. Only one element per view may do so. |
placeholder | PlainText|string|null — Sets the placeholder text shown before a value is chosen. |
extensions | JsonObject|null — Additional JSON fields; modeled names and type are reserved. |
| Throws | When |
|---|---|
ValidationError | A content or contextual rule fails. PHP rejects incompatible call signatures with native errors. |
Related types: Confirmation, JsonObject, PlainText
ChannelSelectElement
A menu for selecting one public channel. Readonly properties contain normalized values. See Value for inherited with(), fromArray(), fromJson(), toArray(), toJson() and jsonSerialize().
See the Slack reference.
$actionId
Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block.
public readonly ?string $actionId;
$initialChannel
Sets the channel ID selected when the menu loads.
public readonly ?string $initialChannel;
$responseUrlEnabled
Sets whether the selected conversation receives a response URL in the view submission payload. Only valid in modals.
public readonly ?bool $responseUrlEnabled;
$confirm
Sets a confirmation dialog shown before the action is sent.
public readonly ?Confirmation $confirm;
Related types: Confirmation
$focusOnLoad
Sets whether the element receives focus when the view opens. Only one element per view may do so.
public readonly ?bool $focusOnLoad;
$placeholder
Sets the placeholder text shown before a value is chosen.
public readonly ?PlainText $placeholder;
Related types: PlainText
__construct
Construct a validated immutable value.
public function __construct(?string $actionId = NULL, ?string $initialChannel = NULL, ?bool $responseUrlEnabled = NULL, ?Confirmation $confirm = NULL, ?bool $focusOnLoad = NULL, PlainText|string|null $placeholder = NULL, ?JsonObject $extensions = NULL)
| Parameter | Description |
|---|---|
actionId | string|null — Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block. |
initialChannel | string|null — Sets the channel ID selected when the menu loads. |
responseUrlEnabled | bool|null — Sets whether the selected conversation receives a response URL in the view submission payload. Only valid in modals. |
confirm | Confirmation|null — Sets a confirmation dialog shown before the action is sent. |
focusOnLoad | bool|null — Sets whether the element receives focus when the view opens. Only one element per view may do so. |
placeholder | PlainText|string|null — Sets the placeholder text shown before a value is chosen. |
extensions | JsonObject|null — Additional JSON fields; modeled names and type are reserved. |
| Throws | When |
|---|---|
ValidationError | A content or contextual rule fails. PHP rejects incompatible call signatures with native errors. |
Related types: Confirmation, JsonObject, PlainText
CheckboxesElement
A group of checkboxes. Readonly properties contain normalized values. See Value for inherited with(), fromArray(), fromJson(), toArray(), toJson() and jsonSerialize().
See the Slack reference.
$actionId
Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block.
public readonly ?string $actionId;
$options
Adds selectable options in display order.
/** @var list<Option> */
public readonly array $options;
Related types: Option
$initialOptions
Adds options that are selected when the element loads. Each must match an option in the element.
/** @var list<Option>|null */
public readonly ?array $initialOptions;
Related types: Option
$confirm
Sets a confirmation dialog shown before the action is sent.
public readonly ?Confirmation $confirm;
Related types: Confirmation
$focusOnLoad
Sets whether the element receives focus when the view opens. Only one element per view may do so.
public readonly ?bool $focusOnLoad;
__construct
Construct a validated immutable value.
public function __construct(array $options, ?string $actionId = NULL, ?array $initialOptions = NULL, ?Confirmation $confirm = NULL, ?bool $focusOnLoad = NULL, ?JsonObject $extensions = NULL)
| Parameter | Description |
|---|---|
options | list<Option> — Adds selectable options in display order. |
actionId | string|null — Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block. |
initialOptions | list<Option>|null — Adds options that are selected when the element loads. Each must match an option in the element. |
confirm | Confirmation|null — Sets a confirmation dialog shown before the action is sent. |
focusOnLoad | bool|null — Sets whether the element receives focus when the view opens. Only one element per view may do so. |
extensions | JsonObject|null — Additional JSON fields; modeled names and type are reserved. |
| Throws | When |
|---|---|
ValidationError | A content or contextual rule fails. PHP rejects incompatible call signatures with native errors. |
Related types: Confirmation, JsonObject
ConversationMultiSelectElement
A menu for selecting multiple conversations. Readonly properties contain normalized values. See Value for inherited with(), fromArray(), fromJson(), toArray(), toJson() and jsonSerialize().
See the Slack reference.
$actionId
Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block.
public readonly ?string $actionId;
$initialConversations
Adds conversation IDs that are selected when the menu loads.
/** @var list<string>|null */
public readonly ?array $initialConversations;
$defaultToCurrentConversation
Sets whether the menu pre-selects the conversation the user is viewing.
public readonly ?bool $defaultToCurrentConversation;
$filter
Sets which conversation types the menu offers.
public readonly ?ConversationFilter $filter;
Related types: ConversationFilter
$confirm
Sets a confirmation dialog shown before the action is sent.
public readonly ?Confirmation $confirm;
Related types: Confirmation
$maxSelectedItems
Sets the maximum number of items a user can select.
public readonly ?int $maxSelectedItems;
$focusOnLoad
Sets whether the element receives focus when the view opens. Only one element per view may do so.
public readonly ?bool $focusOnLoad;
$placeholder
Sets the placeholder text shown before a value is chosen.
public readonly ?PlainText $placeholder;
Related types: PlainText
__construct
Construct a validated immutable value.
public function __construct(?string $actionId = NULL, ?array $initialConversations = NULL, ?bool $defaultToCurrentConversation = NULL, ?ConversationFilter $filter = NULL, ?Confirmation $confirm = NULL, ?int $maxSelectedItems = NULL, ?bool $focusOnLoad = NULL, PlainText|string|null $placeholder = NULL, ?JsonObject $extensions = NULL)
| Parameter | Description |
|---|---|
actionId | string|null — Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block. |
initialConversations | list<string>|null — Adds conversation IDs that are selected when the menu loads. |
defaultToCurrentConversation | bool|null — Sets whether the menu pre-selects the conversation the user is viewing. |
filter | ConversationFilter|null — Sets which conversation types the menu offers. |
confirm | Confirmation|null — Sets a confirmation dialog shown before the action is sent. |
maxSelectedItems | int|null — Sets the maximum number of items a user can select. |
focusOnLoad | bool|null — Sets whether the element receives focus when the view opens. Only one element per view may do so. |
placeholder | PlainText|string|null — Sets the placeholder text shown before a value is chosen. |
extensions | JsonObject|null — Additional JSON fields; modeled names and type are reserved. |
| Throws | When |
|---|---|
ValidationError | A content or contextual rule fails. PHP rejects incompatible call signatures with native errors. |
Related types: Confirmation, ConversationFilter, JsonObject, PlainText
ConversationSelectElement
A menu for selecting one conversation. Readonly properties contain normalized values. See Value for inherited with(), fromArray(), fromJson(), toArray(), toJson() and jsonSerialize().
See the Slack reference.
$actionId
Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block.
public readonly ?string $actionId;
$initialConversation
Sets the conversation ID selected when the menu loads.
public readonly ?string $initialConversation;
$defaultToCurrentConversation
Sets whether the menu pre-selects the conversation the user is viewing.
public readonly ?bool $defaultToCurrentConversation;
$filter
Sets which conversation types the menu offers.
public readonly ?ConversationFilter $filter;
Related types: ConversationFilter
$responseUrlEnabled
Sets whether the selected conversation receives a response URL in the view submission payload. Only valid in modals.
public readonly ?bool $responseUrlEnabled;
$confirm
Sets a confirmation dialog shown before the action is sent.
public readonly ?Confirmation $confirm;
Related types: Confirmation
$focusOnLoad
Sets whether the element receives focus when the view opens. Only one element per view may do so.
public readonly ?bool $focusOnLoad;
$placeholder
Sets the placeholder text shown before a value is chosen.
public readonly ?PlainText $placeholder;
Related types: PlainText
__construct
Construct a validated immutable value.
public function __construct(?string $actionId = NULL, ?string $initialConversation = NULL, ?bool $defaultToCurrentConversation = NULL, ?ConversationFilter $filter = NULL, ?bool $responseUrlEnabled = NULL, ?Confirmation $confirm = NULL, ?bool $focusOnLoad = NULL, PlainText|string|null $placeholder = NULL, ?JsonObject $extensions = NULL)
| Parameter | Description |
|---|---|
actionId | string|null — Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block. |
initialConversation | string|null — Sets the conversation ID selected when the menu loads. |
defaultToCurrentConversation | bool|null — Sets whether the menu pre-selects the conversation the user is viewing. |
filter | ConversationFilter|null — Sets which conversation types the menu offers. |
responseUrlEnabled | bool|null — Sets whether the selected conversation receives a response URL in the view submission payload. Only valid in modals. |
confirm | Confirmation|null — Sets a confirmation dialog shown before the action is sent. |
focusOnLoad | bool|null — Sets whether the element receives focus when the view opens. Only one element per view may do so. |
placeholder | PlainText|string|null — Sets the placeholder text shown before a value is chosen. |
extensions | JsonObject|null — Additional JSON fields; modeled names and type are reserved. |
| Throws | When |
|---|---|
ValidationError | A content or contextual rule fails. PHP rejects incompatible call signatures with native errors. |
Related types: Confirmation, ConversationFilter, JsonObject, PlainText
DatePickerElement
A calendar date picker. Readonly properties contain normalized values. See Value for inherited with(), fromArray(), fromJson(), toArray(), toJson() and jsonSerialize().
See the Slack reference.
$actionId
Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block.
public readonly ?string $actionId;
$initialDate
Sets the initially selected date, formatted as YYYY-MM-DD.
public readonly ?string $initialDate;
$confirm
Sets a confirmation dialog shown before the action is sent.
public readonly ?Confirmation $confirm;
Related types: Confirmation
$focusOnLoad
Sets whether the element receives focus when the view opens. Only one element per view may do so.
public readonly ?bool $focusOnLoad;
$placeholder
Sets the placeholder text shown before a value is chosen.
public readonly ?PlainText $placeholder;
Related types: PlainText
__construct
Construct a validated immutable value.
public function __construct(?string $actionId = NULL, ?string $initialDate = NULL, ?Confirmation $confirm = NULL, ?bool $focusOnLoad = NULL, PlainText|string|null $placeholder = NULL, ?JsonObject $extensions = NULL)
| Parameter | Description |
|---|---|
actionId | string|null — Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block. |
initialDate | string|null — Sets the initially selected date, formatted as YYYY-MM-DD. |
confirm | Confirmation|null — Sets a confirmation dialog shown before the action is sent. |
focusOnLoad | bool|null — Sets whether the element receives focus when the view opens. Only one element per view may do so. |
placeholder | PlainText|string|null — Sets the placeholder text shown before a value is chosen. |
extensions | JsonObject|null — Additional JSON fields; modeled names and type are reserved. |
| Throws | When |
|---|---|
ValidationError | A content or contextual rule fails. PHP rejects incompatible call signatures with native errors. |
Related types: Confirmation, JsonObject, PlainText
DateTimePickerElement
A combined date and time picker. Readonly properties contain normalized values. See Value for inherited with(), fromArray(), fromJson(), toArray(), toJson() and jsonSerialize().
See the Slack reference.
$actionId
Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block.
public readonly ?string $actionId;
$initialDateTime
Sets the initially selected moment as a UNIX timestamp in seconds.
public readonly ?int $initialDateTime;
$confirm
Sets a confirmation dialog shown before the action is sent.
public readonly ?Confirmation $confirm;
Related types: Confirmation
$focusOnLoad
Sets whether the element receives focus when the view opens. Only one element per view may do so.
public readonly ?bool $focusOnLoad;
__construct
Construct a validated immutable value.
public function __construct(?string $actionId = NULL, ?int $initialDateTime = NULL, ?Confirmation $confirm = NULL, ?bool $focusOnLoad = NULL, ?JsonObject $extensions = NULL)
| Parameter | Description |
|---|---|
actionId | string|null — Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block. |
initialDateTime | int|null — Sets the initially selected moment as a UNIX timestamp in seconds. |
confirm | Confirmation|null — Sets a confirmation dialog shown before the action is sent. |
focusOnLoad | bool|null — Sets whether the element receives focus when the view opens. Only one element per view may do so. |
extensions | JsonObject|null — Additional JSON fields; modeled names and type are reserved. |
| Throws | When |
|---|---|
ValidationError | A content or contextual rule fails. PHP rejects incompatible call signatures with native errors. |
Related types: Confirmation, JsonObject
EmailInputElement
A single-line input that accepts an email address. Readonly properties contain normalized values. See Value for inherited with(), fromArray(), fromJson(), toArray(), toJson() and jsonSerialize().
See the Slack reference.
$actionId
Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block.
public readonly ?string $actionId;
$initialValue
Sets the value present when the input loads.
public readonly ?string $initialValue;
$dispatchActionConfig
Sets which user interactions send a block_actions payload.
public readonly ?DispatchActionConfiguration $dispatchActionConfig;
Related types: DispatchActionConfiguration
$focusOnLoad
Sets whether the element receives focus when the view opens. Only one element per view may do so.
public readonly ?bool $focusOnLoad;
$placeholder
Sets the placeholder text shown before a value is chosen.
public readonly ?PlainText $placeholder;
Related types: PlainText
__construct
Construct a validated immutable value.
public function __construct(?string $actionId = NULL, ?string $initialValue = NULL, ?DispatchActionConfiguration $dispatchActionConfig = NULL, ?bool $focusOnLoad = NULL, PlainText|string|null $placeholder = NULL, ?JsonObject $extensions = NULL)
| Parameter | Description |
|---|---|
actionId | string|null — Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block. |
initialValue | string|null — Sets the value present when the input loads. |
dispatchActionConfig | DispatchActionConfiguration|null — Sets which user interactions send a block_actions payload. |
focusOnLoad | bool|null — Sets whether the element receives focus when the view opens. Only one element per view may do so. |
placeholder | PlainText|string|null — Sets the placeholder text shown before a value is chosen. |
extensions | JsonObject|null — Additional JSON fields; modeled names and type are reserved. |
| Throws | When |
|---|---|
ValidationError | A content or contextual rule fails. PHP rejects incompatible call signatures with native errors. |
Related types: DispatchActionConfiguration, JsonObject, PlainText
ExternalMultiSelectElement
A menu for selecting multiple options loaded from your app. Readonly properties contain normalized values. See Value for inherited with(), fromArray(), fromJson(), toArray(), toJson() and jsonSerialize().
See the Slack reference.
$actionId
Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block.
public readonly ?string $actionId;
$minQueryLength
Sets how many characters the user must type before Slack queries your options endpoint.
public readonly ?int $minQueryLength;
$initialOptions
Adds options that are selected when the element loads. Each must match an option in the element.
/** @var list<Option>|null */
public readonly ?array $initialOptions;
Related types: Option
$confirm
Sets a confirmation dialog shown before the action is sent.
public readonly ?Confirmation $confirm;
Related types: Confirmation
$maxSelectedItems
Sets the maximum number of items a user can select.
public readonly ?int $maxSelectedItems;
$focusOnLoad
Sets whether the element receives focus when the view opens. Only one element per view may do so.
public readonly ?bool $focusOnLoad;
$placeholder
Sets the placeholder text shown before a value is chosen.
public readonly ?PlainText $placeholder;
Related types: PlainText
__construct
Construct a validated immutable value.
public function __construct(?string $actionId = NULL, ?int $minQueryLength = NULL, ?array $initialOptions = NULL, ?Confirmation $confirm = NULL, ?int $maxSelectedItems = NULL, ?bool $focusOnLoad = NULL, PlainText|string|null $placeholder = NULL, ?JsonObject $extensions = NULL)
| Parameter | Description |
|---|---|
actionId | string|null — Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block. |
minQueryLength | int|null — Sets how many characters the user must type before Slack queries your options endpoint. |
initialOptions | list<Option>|null — Adds options that are selected when the element loads. Each must match an option in the element. |
confirm | Confirmation|null — Sets a confirmation dialog shown before the action is sent. |
maxSelectedItems | int|null — Sets the maximum number of items a user can select. |
focusOnLoad | bool|null — Sets whether the element receives focus when the view opens. Only one element per view may do so. |
placeholder | PlainText|string|null — Sets the placeholder text shown before a value is chosen. |
extensions | JsonObject|null — Additional JSON fields; modeled names and type are reserved. |
| Throws | When |
|---|---|
ValidationError | A content or contextual rule fails. PHP rejects incompatible call signatures with native errors. |
Related types: Confirmation, JsonObject, PlainText
ExternalSelectElement
A menu for selecting one option loaded from your app. Readonly properties contain normalized values. See Value for inherited with(), fromArray(), fromJson(), toArray(), toJson() and jsonSerialize().
See the Slack reference.
$actionId
Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block.
public readonly ?string $actionId;
$minQueryLength
Sets how many characters the user must type before Slack queries your options endpoint.
public readonly ?int $minQueryLength;
$initialOption
Sets the option selected when the element loads. It must match an option in the element.
public readonly ?Option $initialOption;
Related types: Option
$confirm
Sets a confirmation dialog shown before the action is sent.
public readonly ?Confirmation $confirm;
Related types: Confirmation
$focusOnLoad
Sets whether the element receives focus when the view opens. Only one element per view may do so.
public readonly ?bool $focusOnLoad;
$placeholder
Sets the placeholder text shown before a value is chosen.
public readonly ?PlainText $placeholder;
Related types: PlainText
__construct
Construct a validated immutable value.
public function __construct(?string $actionId = NULL, ?int $minQueryLength = NULL, ?Option $initialOption = NULL, ?Confirmation $confirm = NULL, ?bool $focusOnLoad = NULL, PlainText|string|null $placeholder = NULL, ?JsonObject $extensions = NULL)
| Parameter | Description |
|---|---|
actionId | string|null — Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block. |
minQueryLength | int|null — Sets how many characters the user must type before Slack queries your options endpoint. |
initialOption | Option|null — Sets the option selected when the element loads. It must match an option in the element. |
confirm | Confirmation|null — Sets a confirmation dialog shown before the action is sent. |
focusOnLoad | bool|null — Sets whether the element receives focus when the view opens. Only one element per view may do so. |
placeholder | PlainText|string|null — Sets the placeholder text shown before a value is chosen. |
extensions | JsonObject|null — Additional JSON fields; modeled names and type are reserved. |
| Throws | When |
|---|---|
ValidationError | A content or contextual rule fails. PHP rejects incompatible call signatures with native errors. |
Related types: Confirmation, JsonObject, Option, PlainText
FeedbackButtonsElement
A pair of thumbs-up and thumbs-down feedback buttons. Readonly properties contain normalized values. See Value for inherited with(), fromArray(), fromJson(), toArray(), toJson() and jsonSerialize().
See the Slack reference.
$positiveButton
Sets the button for positive feedback.
public readonly FeedbackButton $positiveButton;
Related types: FeedbackButton
$negativeButton
Sets the button for negative feedback.
public readonly FeedbackButton $negativeButton;
Related types: FeedbackButton
$actionId
Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block.
public readonly ?string $actionId;
__construct
Construct a validated immutable value.
public function __construct(FeedbackButton $positiveButton, FeedbackButton $negativeButton, ?string $actionId = NULL, ?JsonObject $extensions = NULL)
| Parameter | Description |
|---|---|
positiveButton | FeedbackButton — Sets the button for positive feedback. |
negativeButton | FeedbackButton — Sets the button for negative feedback. |
actionId | string|null — Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block. |
extensions | JsonObject|null — Additional JSON fields; modeled names and type are reserved. |
| Throws | When |
|---|---|
ValidationError | A content or contextual rule fails. PHP rejects incompatible call signatures with native errors. |
Related types: FeedbackButton, JsonObject
FileInputElement
An input that lets users upload files. Readonly properties contain normalized values. See Value for inherited with(), fromArray(), fromJson(), toArray(), toJson() and jsonSerialize().
See the Slack reference.
$actionId
Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block.
public readonly ?string $actionId;
$filetypes
Adds accepted file extensions, such as pdf or png.
/** @var list<string>|null */
public readonly ?array $filetypes;
$maxFiles
Sets the maximum number of files a user can upload.
public readonly ?int $maxFiles;
__construct
Construct a validated immutable value.
public function __construct(?string $actionId = NULL, ?array $filetypes = NULL, ?int $maxFiles = NULL, ?JsonObject $extensions = NULL)
| Parameter | Description |
|---|---|
actionId | string|null — Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block. |
filetypes | list<string>|null — Adds accepted file extensions, such as pdf or png. |
maxFiles | int|null — Sets the maximum number of files a user can upload. |
extensions | JsonObject|null — Additional JSON fields; modeled names and type are reserved. |
| Throws | When |
|---|---|
ValidationError | A content or contextual rule fails. PHP rejects incompatible call signatures with native errors. |
Related types: JsonObject
IconButtonElement
A button that shows an icon instead of text. Readonly properties contain normalized values. See Value for inherited with(), fromArray(), fromJson(), toArray(), toJson() and jsonSerialize().
See the Slack reference.
$text
Sets the text used as the button's accessible name.
public readonly PlainText $text;
Related types: PlainText
$icon
Sets the icon shown on the button.
public readonly IconButtonIcon $icon;
Related types: IconButtonIcon
$actionId
Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block.
public readonly ?string $actionId;
$value
Sets the application-defined value sent in interaction payloads.
public readonly ?string $value;
$confirm
Sets a confirmation dialog shown before the action is sent.
public readonly ?Confirmation $confirm;
Related types: Confirmation
$accessibilityLabel
Sets the label read by screen readers in place of the visible text.
public readonly ?string $accessibilityLabel;
$visibleToUserIds
Adds the IDs of users who can see this button.
/** @var list<string>|null */
public readonly ?array $visibleToUserIds;
__construct
Construct a validated immutable value.
public function __construct(PlainText|string $text, IconButtonIcon $icon = IconButtonIcon::Trash, ?string $actionId = NULL, ?string $value = NULL, ?Confirmation $confirm = NULL, ?string $accessibilityLabel = NULL, ?array $visibleToUserIds = NULL, ?JsonObject $extensions = NULL)
| Parameter | Description |
|---|---|
text | PlainText|string — Sets the text used as the button's accessible name. |
icon | IconButtonIcon — Sets the icon shown on the button. |
actionId | string|null — Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block. |
value | string|null — Sets the application-defined value sent in interaction payloads. |
confirm | Confirmation|null — Sets a confirmation dialog shown before the action is sent. |
accessibilityLabel | string|null — Sets the label read by screen readers in place of the visible text. |
visibleToUserIds | list<string>|null — Adds the IDs of users who can see this button. |
extensions | JsonObject|null — Additional JSON fields; modeled names and type are reserved. |
| Throws | When |
|---|---|
ValidationError | A content or contextual rule fails. PHP rejects incompatible call signatures with native errors. |
Related types: Confirmation, IconButtonIcon, JsonObject, PlainText
ImageElement
An image displayed inside a section, context, or card. Provide exactly one of an image URL or a Slack file. Readonly properties contain normalized values. See Value for inherited with(), fromArray(), fromJson(), toArray(), toJson() and jsonSerialize().
See the Slack reference.
$altText
Sets a plain-text summary of the image or video for assistive technology.
public readonly string $altText;
$imageUrl
Sets the publicly accessible URL of the image. Cannot be combined with a Slack file.
public readonly ?string $imageUrl;
$slackFile
Sets a file hosted in Slack as the image source. Cannot be combined with an image URL.
public readonly ?SlackFile $slackFile;
Related types: SlackFile
__construct
Construct a validated immutable value.
public function __construct(string $altText, ?string $imageUrl = NULL, ?SlackFile $slackFile = NULL, ?JsonObject $extensions = NULL)
| Parameter | Description |
|---|---|
altText | string — Sets a plain-text summary of the image or video for assistive technology. |
imageUrl | string|null — Sets the publicly accessible URL of the image. Cannot be combined with a Slack file. |
slackFile | SlackFile|null — Sets a file hosted in Slack as the image source. Cannot be combined with an image URL. |
extensions | JsonObject|null — Additional JSON fields; modeled names and type are reserved. |
| Throws | When |
|---|---|
ValidationError | A content or contextual rule fails. PHP rejects incompatible call signatures with native errors. |
Related types: JsonObject, SlackFile
NumberInputElement
An input that accepts whole or decimal numbers. The minimum value cannot exceed the maximum value. Readonly properties contain normalized values. See Value for inherited with(), fromArray(), fromJson(), toArray(), toJson() and jsonSerialize().
See the Slack reference.
$actionId
Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block.
public readonly ?string $actionId;
$isDecimalAllowed
Sets whether the input accepts decimal numbers.
public readonly bool $isDecimalAllowed;
$initialValue
Sets the number present when the input loads, as a string such as 42 or 3.5.
public readonly ?string $initialValue;
$minValue
Sets the smallest accepted number.
public readonly int|float|null $minValue;
$maxValue
Sets the largest accepted number.
public readonly int|float|null $maxValue;
$dispatchActionConfig
Sets which user interactions send a block_actions payload.
public readonly ?DispatchActionConfiguration $dispatchActionConfig;
Related types: DispatchActionConfiguration
$focusOnLoad
Sets whether the element receives focus when the view opens. Only one element per view may do so.
public readonly ?bool $focusOnLoad;
$placeholder
Sets the placeholder text shown before a value is chosen.
public readonly ?PlainText $placeholder;
Related types: PlainText
__construct
Construct a validated immutable value.
public function __construct(bool $isDecimalAllowed, ?string $actionId = NULL, ?string $initialValue = NULL, int|float|null $minValue = NULL, int|float|null $maxValue = NULL, ?DispatchActionConfiguration $dispatchActionConfig = NULL, ?bool $focusOnLoad = NULL, PlainText|string|null $placeholder = NULL, ?JsonObject $extensions = NULL)
| Parameter | Description |
|---|---|
isDecimalAllowed | bool — Sets whether the input accepts decimal numbers. |
actionId | string|null — Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block. |
initialValue | string|null — Sets the number present when the input loads, as a string such as 42 or 3.5. |
minValue | int|float|null — Sets the smallest accepted number. |
maxValue | int|float|null — Sets the largest accepted number. |
dispatchActionConfig | DispatchActionConfiguration|null — Sets which user interactions send a block_actions payload. |
focusOnLoad | bool|null — Sets whether the element receives focus when the view opens. Only one element per view may do so. |
placeholder | PlainText|string|null — Sets the placeholder text shown before a value is chosen. |
extensions | JsonObject|null — Additional JSON fields; modeled names and type are reserved. |
| Throws | When |
|---|---|
ValidationError | A content or contextual rule fails. PHP rejects incompatible call signatures with native errors. |
Related types: DispatchActionConfiguration, JsonObject, PlainText
OverflowElement
A compact menu of up to five options. Readonly properties contain normalized values. See Value for inherited with(), fromArray(), fromJson(), toArray(), toJson() and jsonSerialize().
See the Slack reference.
$actionId
Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block.
public readonly ?string $actionId;
$options
Adds selectable options in display order.
/** @var list<Option> */
public readonly array $options;
Related types: Option
$confirm
Sets a confirmation dialog shown before the action is sent.
public readonly ?Confirmation $confirm;
Related types: Confirmation
__construct
Construct a validated immutable value.
public function __construct(array $options, ?string $actionId = NULL, ?Confirmation $confirm = NULL, ?JsonObject $extensions = NULL)
| Parameter | Description |
|---|---|
options | list<Option> — Adds selectable options in display order. |
actionId | string|null — Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block. |
confirm | Confirmation|null — Sets a confirmation dialog shown before the action is sent. |
extensions | JsonObject|null — Additional JSON fields; modeled names and type are reserved. |
| Throws | When |
|---|---|
ValidationError | A content or contextual rule fails. PHP rejects incompatible call signatures with native errors. |
Related types: Confirmation, JsonObject
PlainTextInputElement
A single-line or multi-line free-text input. Readonly properties contain normalized values. See Value for inherited with(), fromArray(), fromJson(), toArray(), toJson() and jsonSerialize().
See the Slack reference.
$actionId
Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block.
public readonly ?string $actionId;
$initialValue
Sets the value present when the input loads.
public readonly ?string $initialValue;
$multiline
Sets whether the input is a multi-line text area.
public readonly ?bool $multiline;
$minLength
Sets the minimum number of characters the user must enter.
public readonly ?int $minLength;
$maxLength
Sets the maximum number of characters the user can enter.
public readonly ?int $maxLength;
$dispatchActionConfig
Sets which user interactions send a block_actions payload.
public readonly ?DispatchActionConfiguration $dispatchActionConfig;
Related types: DispatchActionConfiguration
$focusOnLoad
Sets whether the element receives focus when the view opens. Only one element per view may do so.
public readonly ?bool $focusOnLoad;
$placeholder
Sets the placeholder text shown before a value is chosen.
public readonly ?PlainText $placeholder;
Related types: PlainText
__construct
Construct a validated immutable value.
public function __construct(?string $actionId = NULL, ?string $initialValue = NULL, ?bool $multiline = NULL, ?int $minLength = NULL, ?int $maxLength = NULL, ?DispatchActionConfiguration $dispatchActionConfig = NULL, ?bool $focusOnLoad = NULL, PlainText|string|null $placeholder = NULL, ?JsonObject $extensions = NULL)
| Parameter | Description |
|---|---|
actionId | string|null — Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block. |
initialValue | string|null — Sets the value present when the input loads. |
multiline | bool|null — Sets whether the input is a multi-line text area. |
minLength | int|null — Sets the minimum number of characters the user must enter. |
maxLength | int|null — Sets the maximum number of characters the user can enter. |
dispatchActionConfig | DispatchActionConfiguration|null — Sets which user interactions send a block_actions payload. |
focusOnLoad | bool|null — Sets whether the element receives focus when the view opens. Only one element per view may do so. |
placeholder | PlainText|string|null — Sets the placeholder text shown before a value is chosen. |
extensions | JsonObject|null — Additional JSON fields; modeled names and type are reserved. |
| Throws | When |
|---|---|
ValidationError | A content or contextual rule fails. PHP rejects incompatible call signatures with native errors. |
Related types: DispatchActionConfiguration, JsonObject, PlainText
RadioButtonsElement
A group of radio buttons. Readonly properties contain normalized values. See Value for inherited with(), fromArray(), fromJson(), toArray(), toJson() and jsonSerialize().
See the Slack reference.
$actionId
Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block.
public readonly ?string $actionId;
$options
Adds selectable options in display order.
/** @var list<Option> */
public readonly array $options;
Related types: Option
$initialOption
Sets the option selected when the element loads. It must match an option in the element.
public readonly ?Option $initialOption;
Related types: Option
$confirm
Sets a confirmation dialog shown before the action is sent.
public readonly ?Confirmation $confirm;
Related types: Confirmation
$focusOnLoad
Sets whether the element receives focus when the view opens. Only one element per view may do so.
public readonly ?bool $focusOnLoad;
__construct
Construct a validated immutable value.
public function __construct(array $options, ?string $actionId = NULL, ?Option $initialOption = NULL, ?Confirmation $confirm = NULL, ?bool $focusOnLoad = NULL, ?JsonObject $extensions = NULL)
| Parameter | Description |
|---|---|
options | list<Option> — Adds selectable options in display order. |
actionId | string|null — Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block. |
initialOption | Option|null — Sets the option selected when the element loads. It must match an option in the element. |
confirm | Confirmation|null — Sets a confirmation dialog shown before the action is sent. |
focusOnLoad | bool|null — Sets whether the element receives focus when the view opens. Only one element per view may do so. |
extensions | JsonObject|null — Additional JSON fields; modeled names and type are reserved. |
| Throws | When |
|---|---|
ValidationError | A content or contextual rule fails. PHP rejects incompatible call signatures with native errors. |
Related types: Confirmation, JsonObject, Option
RichTextInputElement
An input that accepts formatted rich text. Readonly properties contain normalized values. See Value for inherited with(), fromArray(), fromJson(), toArray(), toJson() and jsonSerialize().
See the Slack reference.
$actionId
Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block.
public readonly string $actionId;
$initialValue
Sets the rich text present when the input loads.
public readonly ?RichTextBlock $initialValue;
Related types: RichTextBlock
$dispatchActionConfig
Sets which user interactions send a block_actions payload.
public readonly ?DispatchActionConfiguration $dispatchActionConfig;
Related types: DispatchActionConfiguration
$focusOnLoad
Sets whether the element receives focus when the view opens. Only one element per view may do so.
public readonly ?bool $focusOnLoad;
$placeholder
Sets the placeholder text shown before a value is chosen.
public readonly ?PlainText $placeholder;
Related types: PlainText
$minLines
Sets the minimum visible height of the input, in lines.
public readonly ?int $minLines;
$maxLines
Sets the maximum visible height of the input, in lines.
public readonly ?int $maxLines;
__construct
Construct a validated immutable value.
public function __construct(string $actionId, ?RichTextBlock $initialValue = NULL, ?DispatchActionConfiguration $dispatchActionConfig = NULL, ?bool $focusOnLoad = NULL, PlainText|string|null $placeholder = NULL, ?int $minLines = NULL, ?int $maxLines = NULL, ?JsonObject $extensions = NULL)
| Parameter | Description |
|---|---|
actionId | string — Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block. |
initialValue | RichTextBlock|null — Sets the rich text present when the input loads. |
dispatchActionConfig | DispatchActionConfiguration|null — Sets which user interactions send a block_actions payload. |
focusOnLoad | bool|null — Sets whether the element receives focus when the view opens. Only one element per view may do so. |
placeholder | PlainText|string|null — Sets the placeholder text shown before a value is chosen. |
minLines | int|null — Sets the minimum visible height of the input, in lines. |
maxLines | int|null — Sets the maximum visible height of the input, in lines. |
extensions | JsonObject|null — Additional JSON fields; modeled names and type are reserved. |
| Throws | When |
|---|---|
ValidationError | A content or contextual rule fails. PHP rejects incompatible call signatures with native errors. |
Related types: DispatchActionConfiguration, JsonObject, PlainText, RichTextBlock
StaticMultiSelectElement
A menu for selecting multiple options defined in the payload. Use options or option groups, not both. Readonly properties contain normalized values. See Value for inherited with(), fromArray(), fromJson(), toArray(), toJson() and jsonSerialize().
See the Slack reference.
$actionId
Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block.
public readonly ?string $actionId;
$options
Adds selectable options in display order.
/** @var list<Option>|null */
public readonly ?array $options;
Related types: Option
$optionGroups
Adds labelled groups of options in display order. Cannot be combined with ungrouped options.
/** @var list<OptionGroup>|null */
public readonly ?array $optionGroups;
Related types: OptionGroup
$initialOptions
Adds options that are selected when the element loads. Each must match an option in the element.
/** @var list<Option>|null */
public readonly ?array $initialOptions;
Related types: Option
$confirm
Sets a confirmation dialog shown before the action is sent.
public readonly ?Confirmation $confirm;
Related types: Confirmation
$maxSelectedItems
Sets the maximum number of items a user can select.
public readonly ?int $maxSelectedItems;
$focusOnLoad
Sets whether the element receives focus when the view opens. Only one element per view may do so.
public readonly ?bool $focusOnLoad;
$placeholder
Sets the placeholder text shown before a value is chosen.
public readonly ?PlainText $placeholder;
Related types: PlainText
__construct
Construct a validated immutable value.
public function __construct(?string $actionId = NULL, ?array $options = NULL, ?array $optionGroups = NULL, ?array $initialOptions = NULL, ?Confirmation $confirm = NULL, ?int $maxSelectedItems = NULL, ?bool $focusOnLoad = NULL, PlainText|string|null $placeholder = NULL, ?JsonObject $extensions = NULL)
| Parameter | Description |
|---|---|
actionId | string|null — Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block. |
options | list<Option>|null — Adds selectable options in display order. |
optionGroups | list<OptionGroup>|null — Adds labelled groups of options in display order. Cannot be combined with ungrouped options. |
initialOptions | list<Option>|null — Adds options that are selected when the element loads. Each must match an option in the element. |
confirm | Confirmation|null — Sets a confirmation dialog shown before the action is sent. |
maxSelectedItems | int|null — Sets the maximum number of items a user can select. |
focusOnLoad | bool|null — Sets whether the element receives focus when the view opens. Only one element per view may do so. |
placeholder | PlainText|string|null — Sets the placeholder text shown before a value is chosen. |
extensions | JsonObject|null — Additional JSON fields; modeled names and type are reserved. |
| Throws | When |
|---|---|
ValidationError | A content or contextual rule fails. PHP rejects incompatible call signatures with native errors. |
Related types: Confirmation, JsonObject, PlainText
StaticSelectElement
A menu for selecting one option defined in the payload. Use options or option groups, not both. Readonly properties contain normalized values. See Value for inherited with(), fromArray(), fromJson(), toArray(), toJson() and jsonSerialize().
See the Slack reference.
$actionId
Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block.
public readonly ?string $actionId;
$options
Adds selectable options in display order.
/** @var list<Option>|null */
public readonly ?array $options;
Related types: Option
$optionGroups
Adds labelled groups of options in display order. Cannot be combined with ungrouped options.
/** @var list<OptionGroup>|null */
public readonly ?array $optionGroups;
Related types: OptionGroup
$initialOption
Sets the option selected when the element loads. It must match an option in the element.
public readonly ?Option $initialOption;
Related types: Option
$confirm
Sets a confirmation dialog shown before the action is sent.
public readonly ?Confirmation $confirm;
Related types: Confirmation
$focusOnLoad
Sets whether the element receives focus when the view opens. Only one element per view may do so.
public readonly ?bool $focusOnLoad;
$placeholder
Sets the placeholder text shown before a value is chosen.
public readonly ?PlainText $placeholder;
Related types: PlainText
__construct
Construct a validated immutable value.
public function __construct(?string $actionId = NULL, ?array $options = NULL, ?array $optionGroups = NULL, ?Option $initialOption = NULL, ?Confirmation $confirm = NULL, ?bool $focusOnLoad = NULL, PlainText|string|null $placeholder = NULL, ?JsonObject $extensions = NULL)
| Parameter | Description |
|---|---|
actionId | string|null — Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block. |
options | list<Option>|null — Adds selectable options in display order. |
optionGroups | list<OptionGroup>|null — Adds labelled groups of options in display order. Cannot be combined with ungrouped options. |
initialOption | Option|null — Sets the option selected when the element loads. It must match an option in the element. |
confirm | Confirmation|null — Sets a confirmation dialog shown before the action is sent. |
focusOnLoad | bool|null — Sets whether the element receives focus when the view opens. Only one element per view may do so. |
placeholder | PlainText|string|null — Sets the placeholder text shown before a value is chosen. |
extensions | JsonObject|null — Additional JSON fields; modeled names and type are reserved. |
| Throws | When |
|---|---|
ValidationError | A content or contextual rule fails. PHP rejects incompatible call signatures with native errors. |
Related types: Confirmation, JsonObject, Option, PlainText
TimePickerElement
A time-of-day picker. Readonly properties contain normalized values. See Value for inherited with(), fromArray(), fromJson(), toArray(), toJson() and jsonSerialize().
See the Slack reference.
$actionId
Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block.
public readonly ?string $actionId;
$initialTime
Sets the initially selected time, formatted as HH:mm in 24-hour time.
public readonly ?string $initialTime;
$timezone
Sets the IANA time zone used to display the time, such as Australia/Brisbane.
public readonly ?string $timezone;
$confirm
Sets a confirmation dialog shown before the action is sent.
public readonly ?Confirmation $confirm;
Related types: Confirmation
$focusOnLoad
Sets whether the element receives focus when the view opens. Only one element per view may do so.
public readonly ?bool $focusOnLoad;
$placeholder
Sets the placeholder text shown before a value is chosen.
public readonly ?PlainText $placeholder;
Related types: PlainText
__construct
Construct a validated immutable value.
public function __construct(?string $actionId = NULL, ?string $initialTime = NULL, ?string $timezone = NULL, ?Confirmation $confirm = NULL, ?bool $focusOnLoad = NULL, PlainText|string|null $placeholder = NULL, ?JsonObject $extensions = NULL)
| Parameter | Description |
|---|---|
actionId | string|null — Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block. |
initialTime | string|null — Sets the initially selected time, formatted as HH:mm in 24-hour time. |
timezone | string|null — Sets the IANA time zone used to display the time, such as Australia/Brisbane. |
confirm | Confirmation|null — Sets a confirmation dialog shown before the action is sent. |
focusOnLoad | bool|null — Sets whether the element receives focus when the view opens. Only one element per view may do so. |
placeholder | PlainText|string|null — Sets the placeholder text shown before a value is chosen. |
extensions | JsonObject|null — Additional JSON fields; modeled names and type are reserved. |
| Throws | When |
|---|---|
ValidationError | A content or contextual rule fails. PHP rejects incompatible call signatures with native errors. |
Related types: Confirmation, JsonObject, PlainText
UrlInputElement
A single-line input that accepts a URL. Readonly properties contain normalized values. See Value for inherited with(), fromArray(), fromJson(), toArray(), toJson() and jsonSerialize().
See the Slack reference.
$actionId
Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block.
public readonly ?string $actionId;
$initialValue
Sets the value present when the input loads.
public readonly ?string $initialValue;
$dispatchActionConfig
Sets which user interactions send a block_actions payload.
public readonly ?DispatchActionConfiguration $dispatchActionConfig;
Related types: DispatchActionConfiguration
$focusOnLoad
Sets whether the element receives focus when the view opens. Only one element per view may do so.
public readonly ?bool $focusOnLoad;
$placeholder
Sets the placeholder text shown before a value is chosen.
public readonly ?PlainText $placeholder;
Related types: PlainText
__construct
Construct a validated immutable value.
public function __construct(?string $actionId = NULL, ?string $initialValue = NULL, ?DispatchActionConfiguration $dispatchActionConfig = NULL, ?bool $focusOnLoad = NULL, PlainText|string|null $placeholder = NULL, ?JsonObject $extensions = NULL)
| Parameter | Description |
|---|---|
actionId | string|null — Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block. |
initialValue | string|null — Sets the value present when the input loads. |
dispatchActionConfig | DispatchActionConfiguration|null — Sets which user interactions send a block_actions payload. |
focusOnLoad | bool|null — Sets whether the element receives focus when the view opens. Only one element per view may do so. |
placeholder | PlainText|string|null — Sets the placeholder text shown before a value is chosen. |
extensions | JsonObject|null — Additional JSON fields; modeled names and type are reserved. |
| Throws | When |
|---|---|
ValidationError | A content or contextual rule fails. PHP rejects incompatible call signatures with native errors. |
Related types: DispatchActionConfiguration, JsonObject, PlainText
UserMultiSelectElement
A menu for selecting multiple workspace users. Readonly properties contain normalized values. See Value for inherited with(), fromArray(), fromJson(), toArray(), toJson() and jsonSerialize().
See the Slack reference.
$actionId
Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block.
public readonly ?string $actionId;
$initialUsers
Adds user IDs that are selected when the menu loads.
/** @var list<string>|null */
public readonly ?array $initialUsers;
$confirm
Sets a confirmation dialog shown before the action is sent.
public readonly ?Confirmation $confirm;
Related types: Confirmation
$maxSelectedItems
Sets the maximum number of items a user can select.
public readonly ?int $maxSelectedItems;
$focusOnLoad
Sets whether the element receives focus when the view opens. Only one element per view may do so.
public readonly ?bool $focusOnLoad;
$placeholder
Sets the placeholder text shown before a value is chosen.
public readonly ?PlainText $placeholder;
Related types: PlainText
__construct
Construct a validated immutable value.
public function __construct(?string $actionId = NULL, ?array $initialUsers = NULL, ?Confirmation $confirm = NULL, ?int $maxSelectedItems = NULL, ?bool $focusOnLoad = NULL, PlainText|string|null $placeholder = NULL, ?JsonObject $extensions = NULL)
| Parameter | Description |
|---|---|
actionId | string|null — Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block. |
initialUsers | list<string>|null — Adds user IDs that are selected when the menu loads. |
confirm | Confirmation|null — Sets a confirmation dialog shown before the action is sent. |
maxSelectedItems | int|null — Sets the maximum number of items a user can select. |
focusOnLoad | bool|null — Sets whether the element receives focus when the view opens. Only one element per view may do so. |
placeholder | PlainText|string|null — Sets the placeholder text shown before a value is chosen. |
extensions | JsonObject|null — Additional JSON fields; modeled names and type are reserved. |
| Throws | When |
|---|---|
ValidationError | A content or contextual rule fails. PHP rejects incompatible call signatures with native errors. |
Related types: Confirmation, JsonObject, PlainText
UserSelectElement
A menu for selecting one workspace user. Readonly properties contain normalized values. See Value for inherited with(), fromArray(), fromJson(), toArray(), toJson() and jsonSerialize().
See the Slack reference.
$actionId
Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block.
public readonly ?string $actionId;
$initialUser
Sets the user ID selected when the menu loads.
public readonly ?string $initialUser;
$confirm
Sets a confirmation dialog shown before the action is sent.
public readonly ?Confirmation $confirm;
Related types: Confirmation
$focusOnLoad
Sets whether the element receives focus when the view opens. Only one element per view may do so.
public readonly ?bool $focusOnLoad;
$placeholder
Sets the placeholder text shown before a value is chosen.
public readonly ?PlainText $placeholder;
Related types: PlainText
__construct
Construct a validated immutable value.
public function __construct(?string $actionId = NULL, ?string $initialUser = NULL, ?Confirmation $confirm = NULL, ?bool $focusOnLoad = NULL, PlainText|string|null $placeholder = NULL, ?JsonObject $extensions = NULL)
| Parameter | Description |
|---|---|
actionId | string|null — Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block. |
initialUser | string|null — Sets the user ID selected when the menu loads. |
confirm | Confirmation|null — Sets a confirmation dialog shown before the action is sent. |
focusOnLoad | bool|null — Sets whether the element receives focus when the view opens. Only one element per view may do so. |
placeholder | PlainText|string|null — Sets the placeholder text shown before a value is chosen. |
extensions | JsonObject|null — Additional JSON fields; modeled names and type are reserved. |
| Throws | When |
|---|---|
ValidationError | A content or contextual rule fails. PHP rejects incompatible call signatures with native errors. |
Related types: Confirmation, JsonObject, PlainText
WorkflowButtonElement
A button that starts a workflow through a link trigger. Readonly properties contain normalized values. See Value for inherited with(), fromArray(), fromJson(), toArray(), toJson() and jsonSerialize().
See the Slack reference.
$text
Sets the button label.
public readonly PlainText $text;
Related types: PlainText
$workflow
Sets the workflow started when the button is clicked.
public readonly Workflow $workflow;
Related types: Workflow
$actionId
Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block.
public readonly string $actionId;
$confirm
Sets a confirmation dialog shown before the action is sent.
public readonly ?Confirmation $confirm;
Related types: Confirmation
$style
Sets the button's emphasis. Omit it for the default neutral style.
public readonly ?ButtonStyle $style;
Related types: ButtonStyle
$accessibilityLabel
Sets the label read by screen readers in place of the visible text.
public readonly ?string $accessibilityLabel;
__construct
Construct a validated immutable value.
public function __construct(PlainText|string $text, Workflow $workflow, string $actionId, ?Confirmation $confirm = NULL, ?ButtonStyle $style = NULL, ?string $accessibilityLabel = NULL, ?JsonObject $extensions = NULL)
| Parameter | Description |
|---|---|
text | PlainText|string — Sets the button label. |
workflow | Workflow — Sets the workflow started when the button is clicked. |
actionId | string — Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block. |
confirm | Confirmation|null — Sets a confirmation dialog shown before the action is sent. |
style | ButtonStyle|null — Sets the button's emphasis. Omit it for the default neutral style. |
accessibilityLabel | string|null — Sets the label read by screen readers in place of the visible text. |
extensions | JsonObject|null — Additional JSON fields; modeled names and type are reserved. |
| Throws | When |
|---|---|
ValidationError | A content or contextual rule fails. PHP rejects incompatible call signatures with native errors. |
Related types: ButtonStyle, Confirmation, JsonObject, PlainText, Workflow