Skip to main content

Blocks

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.

ActionsBlock​

A block that holds interactive elements such as buttons and menus. Readonly properties contain normalized values. See Value for inherited with(), fromArray(), fromJson(), toArray(), toJson() and jsonSerialize().

See the Slack reference.

$elements​

Adds interactive elements in display order.

/** @var list<Element> */
public readonly array $elements;

Related types: Element

$blockId​

Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.

public readonly ?string $blockId;

__construct​

Construct a validated immutable value.

public function __construct(array $elements, ?string $blockId = NULL, ?JsonObject $extensions = NULL)
ParameterDescription
elementslist<Element> — Adds interactive elements in display order.
blockIdstring|null — Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.
extensionsJsonObject|null — Additional JSON fields; modeled names and type are reserved.
ThrowsWhen
ValidationErrorA content or contextual rule fails. PHP rejects incompatible call signatures with native errors.

Related types: JsonObject

AlertBlock​

A severity-labelled alert, available in modals. Readonly properties contain normalized values. See Value for inherited with(), fromArray(), fromJson(), toArray(), toJson() and jsonSerialize().

See the Slack reference.

$text​

Sets the alert message.

public readonly Text $text;

Related types: Text

$level​

Sets the alert severity, which controls its color and icon.

public readonly ?AlertLevel $level;

Related types: AlertLevel

$blockId​

Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.

public readonly ?string $blockId;

__construct​

Construct a validated immutable value.

public function __construct(Text|string $text, ?AlertLevel $level = NULL, ?string $blockId = NULL, ?JsonObject $extensions = NULL)
ParameterDescription
textText|string — Sets the alert message.
levelAlertLevel|null — Sets the alert severity, which controls its color and icon.
blockIdstring|null — Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.
extensionsJsonObject|null — Additional JSON fields; modeled names and type are reserved.
ThrowsWhen
ValidationErrorA content or contextual rule fails. PHP rejects incompatible call signatures with native errors.

Related types: AlertLevel, JsonObject, Text

CardBlock​

A compact card with an image, text, and up to three buttons. Provide at least one of a hero image, title, actions, or body. An image icon and a Slack icon cannot be combined. Readonly properties contain normalized values. See Value for inherited with(), fromArray(), fromJson(), toArray(), toJson() and jsonSerialize().

See the Slack reference.

$heroImage​

Sets the image displayed prominently at the top of the card.

public readonly ?ImageElement $heroImage;

Related types: ImageElement

$icon​

Sets the image displayed beside the title.

public readonly ?ImageElement $icon;

Related types: ImageElement

$title​

Sets the card title.

public readonly ?Text $title;

Related types: Text

$subtitle​

Sets the supporting text shown below the title.

public readonly ?Text $subtitle;

Related types: Text

$body​

Sets the main body text of the card.

public readonly ?Text $body;

Related types: Text

$actions​

Adds buttons displayed at the bottom of the card, in display order.

/** @var list<ButtonElement>|null */
public readonly ?array $actions;

Related types: ButtonElement

$slackIcon​

Sets a Slack-provided icon displayed beside the title. Cannot be combined with an image icon.

public readonly ?SlackIcon $slackIcon;

Related types: SlackIcon

$subtext​

Sets the small print shown at the bottom of the card.

public readonly ?Text $subtext;

Related types: Text

$blockId​

Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.

public readonly ?string $blockId;

__construct​

Construct a validated immutable value.

public function __construct(?ImageElement $heroImage = NULL, ?ImageElement $icon = NULL, Text|string|null $title = NULL, Text|string|null $subtitle = NULL, Text|string|null $body = NULL, ?array $actions = NULL, ?SlackIcon $slackIcon = NULL, Text|string|null $subtext = NULL, ?string $blockId = NULL, ?JsonObject $extensions = NULL)
ParameterDescription
heroImageImageElement|null — Sets the image displayed prominently at the top of the card.
iconImageElement|null — Sets the image displayed beside the title.
titleText|string|null — Sets the card title.
subtitleText|string|null — Sets the supporting text shown below the title.
bodyText|string|null — Sets the main body text of the card.
actionslist<ButtonElement>|null — Adds buttons displayed at the bottom of the card, in display order.
slackIconSlackIcon|null — Sets a Slack-provided icon displayed beside the title. Cannot be combined with an image icon.
subtextText|string|null — Sets the small print shown at the bottom of the card.
blockIdstring|null — Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.
extensionsJsonObject|null — Additional JSON fields; modeled names and type are reserved.
ThrowsWhen
ValidationErrorA content or contextual rule fails. PHP rejects incompatible call signatures with native errors.

Related types: ImageElement, JsonObject, SlackIcon, Text

CarouselBlock​

A horizontally scrolling set of cards, available in messages and App Home. Readonly properties contain normalized values. See Value for inherited with(), fromArray(), fromJson(), toArray(), toJson() and jsonSerialize().

See the Slack reference.

$elements​

Adds the cards in display order.

/** @var list<CardBlock> */
public readonly array $elements;

Related types: CardBlock

$blockId​

Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.

public readonly ?string $blockId;

__construct​

Construct a validated immutable value.

public function __construct(array $elements, ?string $blockId = NULL, ?JsonObject $extensions = NULL)
ParameterDescription
elementslist<CardBlock> — Adds the cards in display order.
blockIdstring|null — Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.
extensionsJsonObject|null — Additional JSON fields; modeled names and type are reserved.
ThrowsWhen
ValidationErrorA content or contextual rule fails. PHP rejects incompatible call signatures with native errors.

Related types: JsonObject

ContainerBlock​

A titled group of blocks that can optionally collapse. Provide a title or a rich text title. Readonly properties contain normalized values. See Value for inherited with(), fromArray(), fromJson(), toArray(), toJson() and jsonSerialize().

See the Slack reference.

$childBlocks​

Adds the blocks grouped inside the container, in display order.

/** @var list<Block> */
public readonly array $childBlocks;

Related types: Block

$title​

Sets the container title. Provide either a title or a rich text title.

public readonly ?PlainText $title;

Related types: PlainText

$richTextTitle​

Sets a rich text block used as the title in place of a plain-text title.

public readonly ?RichTextBlock $richTextTitle;

Related types: RichTextBlock

$subtitle​

Sets the supporting text shown below the title.

public readonly ?Text $subtitle;

Related types: Text

$width​

Sets the horizontal width of the container.

public readonly ?ContainerWidth $width;

Related types: ContainerWidth

$icon​

Sets the image displayed beside the title.

public readonly ?ImageElement $icon;

Related types: ImageElement

$isCollapsible​

Sets whether users can collapse and expand the container.

public readonly ?bool $isCollapsible;

$defaultCollapsed​

Sets whether a collapsible container starts collapsed. Requires the container to be collapsible.

public readonly ?bool $defaultCollapsed;

$hasHeaderDivider​

Sets whether Slack draws a divider below the container header. Only valid for non-collapsible containers.

public readonly ?bool $hasHeaderDivider;

$blockId​

Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.

public readonly ?string $blockId;

__construct​

Construct a validated immutable value.

public function __construct(array $childBlocks, PlainText|string|null $title = NULL, ?RichTextBlock $richTextTitle = NULL, Text|string|null $subtitle = NULL, ?ContainerWidth $width = NULL, ?ImageElement $icon = NULL, ?bool $isCollapsible = NULL, ?bool $defaultCollapsed = NULL, ?bool $hasHeaderDivider = NULL, ?string $blockId = NULL, ?JsonObject $extensions = NULL)
ParameterDescription
childBlockslist<Block> — Adds the blocks grouped inside the container, in display order.
titlePlainText|string|null — Sets the container title. Provide either a title or a rich text title.
richTextTitleRichTextBlock|null — Sets a rich text block used as the title in place of a plain-text title.
subtitleText|string|null — Sets the supporting text shown below the title.
widthContainerWidth|null — Sets the horizontal width of the container.
iconImageElement|null — Sets the image displayed beside the title.
isCollapsiblebool|null — Sets whether users can collapse and expand the container.
defaultCollapsedbool|null — Sets whether a collapsible container starts collapsed. Requires the container to be collapsible.
hasHeaderDividerbool|null — Sets whether Slack draws a divider below the container header. Only valid for non-collapsible containers.
blockIdstring|null — Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.
extensionsJsonObject|null — Additional JSON fields; modeled names and type are reserved.
ThrowsWhen
ValidationErrorA content or contextual rule fails. PHP rejects incompatible call signatures with native errors.

Related types: ContainerWidth, ImageElement, JsonObject, PlainText, RichTextBlock, Text

ContextActionsBlock​

A row of feedback or icon buttons, usually shown below AI-generated content. Readonly properties contain normalized values. See Value for inherited with(), fromArray(), fromJson(), toArray(), toJson() and jsonSerialize().

See the Slack reference.

$elements​

Adds feedback buttons or icon buttons in display order.

/** @var list<ContextActionsElement> */
public readonly array $elements;

Related types: ContextActionsElement

$blockId​

Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.

public readonly ?string $blockId;

__construct​

Construct a validated immutable value.

public function __construct(array $elements, ?string $blockId = NULL, ?JsonObject $extensions = NULL)
ParameterDescription
elementslist<ContextActionsElement> — Adds feedback buttons or icon buttons in display order.
blockIdstring|null — Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.
extensionsJsonObject|null — Additional JSON fields; modeled names and type are reserved.
ThrowsWhen
ValidationErrorA content or contextual rule fails. PHP rejects incompatible call signatures with native errors.

Related types: JsonObject

ContextBlock​

A block of small, secondary images and text. Readonly properties contain normalized values. See Value for inherited with(), fromArray(), fromJson(), toArray(), toJson() and jsonSerialize().

See the Slack reference.

$elements​

Adds images and text in display order.

/** @var list<ContextElement> */
public readonly array $elements;

Related types: ContextElement

$blockId​

Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.

public readonly ?string $blockId;

__construct​

Construct a validated immutable value.

public function __construct(array $elements, ?string $blockId = NULL, ?JsonObject $extensions = NULL)
ParameterDescription
elementslist<ContextElement> — Adds images and text in display order.
blockIdstring|null — Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.
extensionsJsonObject|null — Additional JSON fields; modeled names and type are reserved.
ThrowsWhen
ValidationErrorA content or contextual rule fails. PHP rejects incompatible call signatures with native errors.

Related types: JsonObject

DataTableBlock​

A sortable, paginated table of raw text, numbers, and rich text. The first row is the header row and cannot contain rich text. Every row must have the same number of cells, and all cell text together is limited to 20,000 characters. Readonly properties contain normalized values. See Value for inherited with(), fromArray(), fromJson(), toArray(), toJson() and jsonSerialize().

See the Slack reference.

$rows​

Adds complete table rows in display order. Every row must have the same number of cells.

/** @var list<list<DataTableCell>> */
public readonly array $rows;

Related types: DataTableCell

$caption​

Sets the caption that describes the table's contents.

public readonly string $caption;

$pageSize​

Sets how many rows Slack shows per page.

public readonly ?int $pageSize;

$rowHeaderColumnIndex​

Sets the zero-based index of the column whose cells act as row headers.

public readonly ?int $rowHeaderColumnIndex;

$blockId​

Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.

public readonly ?string $blockId;

__construct​

Construct a validated immutable value.

public function __construct(array $rows, string $caption, ?int $pageSize = 5, ?int $rowHeaderColumnIndex = 0, ?string $blockId = NULL, ?JsonObject $extensions = NULL)
ParameterDescription
rowslist<list<DataTableCell>> — Adds complete table rows in display order. Every row must have the same number of cells.
captionstring — Sets the caption that describes the table's contents.
pageSizeint|null — Sets how many rows Slack shows per page.
rowHeaderColumnIndexint|null — Sets the zero-based index of the column whose cells act as row headers.
blockIdstring|null — Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.
extensionsJsonObject|null — Additional JSON fields; modeled names and type are reserved.
ThrowsWhen
ValidationErrorA content or contextual rule fails. PHP rejects incompatible call signatures with native errors.

Related types: JsonObject

DataVisualizationBlock​

A titled pie, bar, area, or line chart. Readonly properties contain normalized values. See Value for inherited with(), fromArray(), fromJson(), toArray(), toJson() and jsonSerialize().

See the Slack reference.

$title​

Sets the chart title.

public readonly string $title;

$chart​

Sets the chart to display.

public readonly Chart $chart;

Related types: Chart

$blockId​

Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.

public readonly ?string $blockId;

__construct​

Construct a validated immutable value.

public function __construct(string $title, Chart $chart, ?string $blockId = NULL, ?JsonObject $extensions = NULL)
ParameterDescription
titlestring — Sets the chart title.
chartChart — Sets the chart to display.
blockIdstring|null — Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.
extensionsJsonObject|null — Additional JSON fields; modeled names and type are reserved.
ThrowsWhen
ValidationErrorA content or contextual rule fails. PHP rejects incompatible call signatures with native errors.

Related types: Chart, JsonObject

DividerBlock​

A horizontal rule that separates blocks. Readonly properties contain normalized values. See Value for inherited with(), fromArray(), fromJson(), toArray(), toJson() and jsonSerialize().

See the Slack reference.

$blockId​

Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.

public readonly ?string $blockId;

__construct​

Construct a validated immutable value.

public function __construct(?string $blockId = NULL, ?JsonObject $extensions = NULL)
ParameterDescription
blockIdstring|null — Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.
extensionsJsonObject|null — Additional JSON fields; modeled names and type are reserved.
ThrowsWhen
ValidationErrorA content or contextual rule fails. PHP rejects incompatible call signatures with native errors.

Related types: JsonObject

FileBlock​

A remote file previously added with the files.remote API. Readonly properties contain normalized values. See Value for inherited with(), fromArray(), fromJson(), toArray(), toJson() and jsonSerialize().

See the Slack reference.

$externalId​

Sets the external identifier of a remote file previously added with the files.remote API.

public readonly string $externalId;

$source​

Sets the file source. Slack currently supports only remote files.

public readonly string $source;

$blockId​

Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.

public readonly ?string $blockId;

__construct​

Construct a validated immutable value.

public function __construct(string $externalId, string $source = 'remote', ?string $blockId = NULL, ?JsonObject $extensions = NULL)
ParameterDescription
externalIdstring — Sets the external identifier of a remote file previously added with the files.remote API.
sourcestring — Sets the file source. Slack currently supports only remote files.
blockIdstring|null — Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.
extensionsJsonObject|null — Additional JSON fields; modeled names and type are reserved.
ThrowsWhen
ValidationErrorA content or contextual rule fails. PHP rejects incompatible call signatures with native errors.

Related types: JsonObject

HeaderBlock​

Large, bold plain text that introduces a group of blocks. Readonly properties contain normalized values. See Value for inherited with(), fromArray(), fromJson(), toArray(), toJson() and jsonSerialize().

See the Slack reference.

$text​

Sets the header text, shown in a larger bold font.

public readonly PlainText $text;

Related types: PlainText

$blockId​

Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.

public readonly ?string $blockId;

__construct​

Construct a validated immutable value.

public function __construct(PlainText|string $text, ?string $blockId = NULL, ?JsonObject $extensions = NULL)
ParameterDescription
textPlainText|string — Sets the header text, shown in a larger bold font.
blockIdstring|null — Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.
extensionsJsonObject|null — Additional JSON fields; modeled names and type are reserved.
ThrowsWhen
ValidationErrorA content or contextual rule fails. PHP rejects incompatible call signatures with native errors.

Related types: JsonObject, PlainText

ImageBlock​

A standalone image with alternative text and an optional title. 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.

$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

$altText​

Sets a plain-text summary of the image or video for assistive technology.

public readonly string $altText;

$title​

Sets the title shown above the image.

public readonly ?PlainText $title;

Related types: PlainText

$blockId​

Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.

public readonly ?string $blockId;

__construct​

Construct a validated immutable value.

public function __construct(string $altText, ?string $imageUrl = NULL, ?SlackFile $slackFile = NULL, PlainText|string|null $title = NULL, ?string $blockId = NULL, ?JsonObject $extensions = NULL)
ParameterDescription
altTextstring — Sets a plain-text summary of the image or video for assistive technology.
imageUrlstring|null — Sets the publicly accessible URL of the image. Cannot be combined with a Slack file.
slackFileSlackFile|null — Sets a file hosted in Slack as the image source. Cannot be combined with an image URL.
titlePlainText|string|null — Sets the title shown above the image.
blockIdstring|null — Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.
extensionsJsonObject|null — Additional JSON fields; modeled names and type are reserved.
ThrowsWhen
ValidationErrorA content or contextual rule fails. PHP rejects incompatible call signatures with native errors.

Related types: JsonObject, PlainText, SlackFile

InputBlock​

A labelled input that collects a value in a modal, App Home, or message. Readonly properties contain normalized values. See Value for inherited with(), fromArray(), fromJson(), toArray(), toJson() and jsonSerialize().

See the Slack reference.

$label​

Sets the label shown above the input.

public readonly PlainText $label;

Related types: PlainText

$element​

Sets the input element that collects the user's value.

public readonly InputElement $element;

Related types: InputElement

$dispatchAction​

Sets whether changing the element sends a block_actions payload immediately.

public readonly ?bool $dispatchAction;

$blockId​

Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.

public readonly ?string $blockId;

$hint​

Sets helper text shown below the input.

public readonly ?PlainText $hint;

Related types: PlainText

$optional​

Sets whether the modal can be submitted when this input is empty.

public readonly ?bool $optional;

__construct​

Construct a validated immutable value.

public function __construct(PlainText|string $label, InputElement $element, ?bool $dispatchAction = NULL, ?string $blockId = NULL, PlainText|string|null $hint = NULL, ?bool $optional = NULL, ?JsonObject $extensions = NULL)
ParameterDescription
labelPlainText|string — Sets the label shown above the input.
elementInputElement — Sets the input element that collects the user's value.
dispatchActionbool|null — Sets whether changing the element sends a block_actions payload immediately.
blockIdstring|null — Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.
hintPlainText|string|null — Sets helper text shown below the input.
optionalbool|null — Sets whether the modal can be submitted when this input is empty.
extensionsJsonObject|null — Additional JSON fields; modeled names and type are reserved.
ThrowsWhen
ValidationErrorA content or contextual rule fails. PHP rejects incompatible call signatures with native errors.

Related types: InputElement, JsonObject, PlainText

MarkdownBlock​

Standard markdown rendered by Slack, intended for AI-generated content. Readonly properties contain normalized values. See Value for inherited with(), fromArray(), fromJson(), toArray(), toJson() and jsonSerialize().

See the Slack reference.

$text​

Sets standard markdown content, which Slack renders directly.

public readonly string $text;

$blockId​

Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.

public readonly ?string $blockId;

__construct​

Construct a validated immutable value.

public function __construct(string $text, ?string $blockId = NULL, ?JsonObject $extensions = NULL)
ParameterDescription
textstring — Sets standard markdown content, which Slack renders directly.
blockIdstring|null — Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.
extensionsJsonObject|null — Additional JSON fields; modeled names and type are reserved.
ThrowsWhen
ValidationErrorA content or contextual rule fails. PHP rejects incompatible call signatures with native errors.

Related types: JsonObject

PlanBlock​

A titled sequence of task cards. Task IDs must be unique within a plan. Readonly properties contain normalized values. See Value for inherited with(), fromArray(), fromJson(), toArray(), toJson() and jsonSerialize().

See the Slack reference.

$title​

Sets the plan title.

public readonly string $title;

$tasks​

Adds task cards in display order.

/** @var list<TaskCardBlock> */
public readonly array $tasks;

Related types: TaskCardBlock

$blockId​

Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.

public readonly ?string $blockId;

__construct​

Construct a validated immutable value.

public function __construct(string $title, array $tasks, ?string $blockId = NULL, ?JsonObject $extensions = NULL)
ParameterDescription
titlestring — Sets the plan title.
taskslist<TaskCardBlock> — Adds task cards in display order.
blockIdstring|null — Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.
extensionsJsonObject|null — Additional JSON fields; modeled names and type are reserved.
ThrowsWhen
ValidationErrorA content or contextual rule fails. PHP rejects incompatible call signatures with native errors.

Related types: JsonObject

RichTextBlock​

Formatted text built from sections, lists, preformatted blocks, and quotes. Readonly properties contain normalized values. See Value for inherited with(), fromArray(), fromJson(), toArray(), toJson() and jsonSerialize().

See the Slack reference.

$elements​

Adds sections, lists, preformatted blocks, and quotes in display order.

/** @var list<RichTextBlockElement> */
public readonly array $elements;

Related types: RichTextBlockElement

$blockId​

Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.

public readonly ?string $blockId;

__construct​

Construct a validated immutable value.

public function __construct(array $elements, ?string $blockId = NULL, ?JsonObject $extensions = NULL)
ParameterDescription
elementslist<RichTextBlockElement> — Adds sections, lists, preformatted blocks, and quotes in display order.
blockIdstring|null — Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.
extensionsJsonObject|null — Additional JSON fields; modeled names and type are reserved.
ThrowsWhen
ValidationErrorA content or contextual rule fails. PHP rejects incompatible call signatures with native errors.

Related types: JsonObject

SectionBlock​

Text, a grid of fields, or both, with an optional accessory element. Provide text, fields, or both. Readonly properties contain normalized values. See Value for inherited with(), fromArray(), fromJson(), toArray(), toJson() and jsonSerialize().

See the Slack reference.

$text​

Sets the main text of the section.

public readonly ?Text $text;

Related types: Text

$fields​

Adds section fields, shown in a two-column grid, in display order.

/** @var list<Text>|null */
public readonly ?array $fields;

Related types: Text

$accessory​

Sets the element displayed beside the section text.

public readonly ?Element $accessory;

Related types: Element

$blockId​

Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.

public readonly ?string $blockId;

__construct​

Construct a validated immutable value.

public function __construct(Text|string|null $text = NULL, ?array $fields = NULL, ?Element $accessory = NULL, ?string $blockId = NULL, ?JsonObject $extensions = NULL)
ParameterDescription
textText|string|null — Sets the main text of the section.
fieldslist<Text|string>|null — Adds section fields, shown in a two-column grid, in display order.
accessoryElement|null — Sets the element displayed beside the section text.
blockIdstring|null — Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.
extensionsJsonObject|null — Additional JSON fields; modeled names and type are reserved.
ThrowsWhen
ValidationErrorA content or contextual rule fails. PHP rejects incompatible call signatures with native errors.

Related types: Element, JsonObject, Text

TableBlock​

A simple table of raw text and rich text cells. Readonly properties contain normalized values. See Value for inherited with(), fromArray(), fromJson(), toArray(), toJson() and jsonSerialize().

See the Slack reference.

$rows​

Adds complete table rows in display order.

/** @var list<list<TableCell>> */
public readonly array $rows;

Related types: TableCell

$columnSettings​

Adds per-column settings in column order. Provide one entry for every column.

/** @var list<ColumnSettings>|null */
public readonly ?array $columnSettings;

Related types: ColumnSettings

$blockId​

Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.

public readonly ?string $blockId;

__construct​

Construct a validated immutable value.

public function __construct(array $rows, ?array $columnSettings = NULL, ?string $blockId = NULL, ?JsonObject $extensions = NULL)
ParameterDescription
rowslist<list<TableCell>> — Adds complete table rows in display order.
columnSettingslist<ColumnSettings>|null — Adds per-column settings in column order. Provide one entry for every column.
blockIdstring|null — Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.
extensionsJsonObject|null — Additional JSON fields; modeled names and type are reserved.
ThrowsWhen
ValidationErrorA content or contextual rule fails. PHP rejects incompatible call signatures with native errors.

Related types: JsonObject

TaskCardBlock​

One task with its status, details, output, and sources. A standalone task card's status cannot be pending; pending is only valid for plan tasks. Readonly properties contain normalized values. See Value for inherited with(), fromArray(), fromJson(), toArray(), toJson() and jsonSerialize().

See the Slack reference.

$taskId​

Sets the identifier of the task.

public readonly string $taskId;

$title​

Sets the task title.

public readonly string $title;

$details​

Sets a rich text description of the task.

public readonly ?RichTextBlock $details;

Related types: RichTextBlock

$output​

Sets rich text describing the task's output.

public readonly ?RichTextBlock $output;

Related types: RichTextBlock

$sources​

Adds links to the sources the task used, in display order.

/** @var list<UrlSource>|null */
public readonly ?array $sources;

Related types: UrlSource

$status​

Sets the task's current state.

public readonly TaskStatus $status;

Related types: TaskStatus

$blockId​

Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.

public readonly ?string $blockId;

__construct​

Construct a validated immutable value.

public function __construct(string $taskId, string $title, TaskStatus $status, ?RichTextBlock $details = NULL, ?RichTextBlock $output = NULL, ?array $sources = NULL, ?string $blockId = NULL, ?JsonObject $extensions = NULL)
ParameterDescription
taskIdstring — Sets the identifier of the task.
titlestring — Sets the task title.
statusTaskStatus — Sets the task's current state.
detailsRichTextBlock|null — Sets a rich text description of the task.
outputRichTextBlock|null — Sets rich text describing the task's output.
sourceslist<UrlSource>|null — Adds links to the sources the task used, in display order.
blockIdstring|null — Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.
extensionsJsonObject|null — Additional JSON fields; modeled names and type are reserved.
ThrowsWhen
ValidationErrorA content or contextual rule fails. PHP rejects incompatible call signatures with native errors.

Related types: JsonObject, RichTextBlock, TaskStatus

VideoBlock​

An embedded video player. 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;

$thumbnailUrl​

Sets the URL of the image shown before the video plays.

public readonly string $thumbnailUrl;

$title​

Sets the video title.

public readonly PlainText $title;

Related types: PlainText

$videoUrl​

Sets the embeddable URL of the video. The domain must be listed in the app's unfurl domains.

public readonly string $videoUrl;

$blockId​

Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.

public readonly ?string $blockId;

$authorName​

Sets the name of the video's author.

public readonly ?string $authorName;

$description​

Sets the video description.

public readonly ?PlainText $description;

Related types: PlainText

$providerIconUrl​

Sets the URL of the video provider's icon.

public readonly ?string $providerIconUrl;

$providerName​

Sets the name of the video provider, such as YouTube.

public readonly ?string $providerName;

$titleUrl​

Sets the HTTPS URL opened when the title is clicked.

public readonly ?string $titleUrl;

__construct​

Construct a validated immutable value.

public function __construct(string $altText, string $thumbnailUrl, PlainText|string $title, string $videoUrl, ?string $blockId = NULL, ?string $authorName = NULL, PlainText|string|null $description = NULL, ?string $providerIconUrl = NULL, ?string $providerName = NULL, ?string $titleUrl = NULL, ?JsonObject $extensions = NULL)
ParameterDescription
altTextstring — Sets a plain-text summary of the image or video for assistive technology.
thumbnailUrlstring — Sets the URL of the image shown before the video plays.
titlePlainText|string — Sets the video title.
videoUrlstring — Sets the embeddable URL of the video. The domain must be listed in the app's unfurl domains.
blockIdstring|null — Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.
authorNamestring|null — Sets the name of the video's author.
descriptionPlainText|string|null — Sets the video description.
providerIconUrlstring|null — Sets the URL of the video provider's icon.
providerNamestring|null — Sets the name of the video provider, such as YouTube.
titleUrlstring|null — Sets the HTTPS URL opened when the title is clicked.
extensionsJsonObject|null — Additional JSON fields; modeled names and type are reserved.
ThrowsWhen
ValidationErrorA content or contextual rule fails. PHP rejects incompatible call signatures with native errors.

Related types: JsonObject, PlainText