Blocks
Fluent builders for the Block Kit containers that make up messages, modals,
and App Home tabs. Each PascalCase function returns a chainable builder; set
its content and options, then call .build() for validated Slack wire data.
See: https://docs.slack.dev/reference/block-kit/blocks.
ActionsBlock()
function ActionsBlock(): FluentBuilder<{
blockId?: string;
elements: JsonObject[];
}, SlackWire<ActionsBlock>>;
Creates a fluent block that holds interactive controls such as buttons, select
menus, and date pickers. Add up to 25 supported elements with elements();
Slack sends their action identifiers back in interaction payloads.
See: https://docs.slack.dev/reference/block-kit/blocks/actions-block.
Chainable setters
Call these setters in any order before .build(). Repeating a singular setter replaces its previous value.
Collection setters accept individual values, nested builders, or arrays and append each call.
| Setter | Value type | Required | Description |
|---|---|---|---|
.elements(...values) | | Yes | Interactive elements displayed in the row. |
.blockId(value) | string | No | Deterministic identifier, up to 255 characters. |
Validation and errors
.build() materializes nested builders and validates the finished Slack object. It throws a typed slackblocks validation error when a required value is missing, a value has the wrong type or range, mutually exclusive setters are combined, or Slack rejects the resulting shape. Pass { validate: false } to .build() only when intentionally creating an intermediate partial object.
Returns
FluentBuilder<{
blockId?: string;
elements: JsonObject[];
}, SlackWire<ActionsBlock>>
AlertBlock()
function AlertBlock(): FluentBuilder<{
blockId?: string;
level?: AlertLevel;
text: TextLike;
}, SlackObject<"alert">>;
Creates a fluent severity-labelled alert for a modal. Supply the alert copy as a string or text object and choose one of Slack's supported severity levels.
See: https://docs.slack.dev/reference/block-kit/blocks/alert-block.
Chainable setters
Call these setters in any order before .build(). Repeating a singular setter replaces its previous value.
| Setter | Value type | Required | Description |
|---|---|---|---|
.text(value) | | Yes | Alert copy. Strings are converted to mrkdwn text. |
.level(value) | | No | Visual severity. Defaults to default. |
.blockId(value) | string | No | Deterministic identifier, up to 255 characters. |
Validation and errors
.build() materializes nested builders and validates the finished Slack object. It throws a typed slackblocks validation error when a required value is missing, a value has the wrong type or range, mutually exclusive setters are combined, or Slack rejects the resulting shape. Pass { validate: false } to .build() only when intentionally creating an intermediate partial object.
Returns
FluentBuilder<{
blockId?: string;
level?: AlertLevel;
text: TextLike;
}, SlackObject<"alert">>
AlertLevel
type AlertLevel = "default" | "info" | "warning" | "error" | "success";
Severity shown by an alert block.
CardBlock()
function CardBlock(): FluentBuilder<CardBlockInput, SlackObject<"card">>;
Creates a fluent compact card containing text, images, and up to three button
actions. A card may stand alone or appear in a CarouselBlock; at least
one visible content field must be set before calling .build().
See: https://docs.slack.dev/reference/block-kit/blocks/card-block.
Chainable setters
Call these setters in any order before .build(). Repeating a singular setter replaces its previous value.
Collection setters accept individual values, nested builders, or arrays and append each call.
| Setter | Value type | Required | Description |
|---|---|---|---|
.heroImage(value) | | No | Large image displayed above the card content. |
.icon(value) | | No | Small image displayed beside the card heading. |
.title(value) | | No | Primary heading, up to 150 characters. |
.subtitle(value) | | No | Secondary heading, up to 150 characters. |
.body(value) | | No | Main card copy, up to 200 characters. |
.actions(...values) | | No | Up to three button actions. |
.slackIcon(value) | | No | Slack-hosted icon created with SlackIcon(). |
.subtext(value) | | No | Supporting copy displayed below the body. |
.blockId(value) | string | No | Deterministic identifier, up to 255 characters. |
Validation and errors
.build() materializes nested builders and validates the finished Slack object. It throws a typed slackblocks validation error when a required value is missing, a value has the wrong type or range, mutually exclusive setters are combined, or Slack rejects the resulting shape. Pass { validate: false } to .build() only when intentionally creating an intermediate partial object.
Returns
FluentBuilder<CardBlockInput, SlackObject<"card">>
CardBlockInput
Content and presentation fields configured by CardBlock(). A card must set at
least one of heroImage, title, actions, or body before it is built.
Properties
| Property | Type | Description |
|---|---|---|
actions? | JsonObject[] | Up to three button actions. |
blockId? | string | Deterministic identifier, up to 255 characters. |
body? | TextLike | Main card copy, up to 200 characters. |
heroImage? | JsonObject | Large image displayed above the card content. |
icon? | JsonObject | Small image displayed beside the card heading. |
slackIcon? | JsonObject | Slack-hosted icon created with slackIcon. |
subtext? | TextLike | Supporting copy displayed below the body. |
subtitle? | TextLike | Secondary heading, up to 150 characters. |
title? | TextLike | Primary heading, up to 150 characters. |
CarouselBlock()
function CarouselBlock(): FluentBuilder<{
blockId?: string;
elements: JsonObject[];
}, SlackObject<"carousel">>;
Creates a fluent horizontally scrolling group of between one and ten cards.
Add each card with elements() using a built card, a CardBlock
builder, or an array containing either form.
See: https://docs.slack.dev/reference/block-kit/blocks/carousel-block.
Chainable setters
Call these setters in any order before .build(). Repeating a singular setter replaces its previous value.
Collection setters accept individual values, nested builders, or arrays and append each call.
| Setter | Value type | Required | Description |
|---|---|---|---|
.elements(...values) | | Yes | Between one and ten objects returned by CardBlock(). |
.blockId(value) | string | No | Deterministic identifier, up to 255 characters. |
Validation and errors
.build() materializes nested builders and validates the finished Slack object. It throws a typed slackblocks validation error when a required value is missing, a value has the wrong type or range, mutually exclusive setters are combined, or Slack rejects the resulting shape. Pass { validate: false } to .build() only when intentionally creating an intermediate partial object.
Returns
FluentBuilder<{
blockId?: string;
elements: JsonObject[];
}, SlackObject<"carousel">>
ContainerBlock()
function ContainerBlock(): FluentBuilder<{
blockId?: string;
childBlocks: JsonObject[];
defaultCollapsed?: boolean;
hasHeaderDivider?: boolean;
icon?: JsonObject;
isCollapsible?: boolean;
richTextTitle?: JsonObject;
subtitle?: TextLike;
title?: TextLike;
width?: ContainerWidth;
}, SlackObject<"container">>;
Creates a fluent titled container that groups up to ten supported child
blocks. Set either title() or richTextTitle() and optionally make the
container collapsible, choose its width, or add supporting header content.
See: https://docs.slack.dev/reference/block-kit/blocks/container-block.
Chainable setters
Call these setters in any order before .build(). Repeating a singular setter replaces its previous value.
Collection setters accept individual values, nested builders, or arrays and append each call.
| Setter | Value type | Required | Description |
|---|---|---|---|
.childBlocks(...values) | | Yes | Up to ten blocks supported by Slack containers. |
.title(value) | | No | Plain-text title. Mutually exclusive with richTextTitle. |
.richTextTitle(value) | | No | Rich-text title block. Mutually exclusive with title. |
.subtitle(value) | | No | Optional supporting copy below the title. |
.width(value) | | No | Container width. Defaults to standard. |
.icon(value) | | No | Optional image displayed in the header. |
.isCollapsible(value) | boolean | No | Whether readers can expand and collapse the container. |
.defaultCollapsed(value) | boolean | No | Whether a collapsible container starts collapsed. |
.hasHeaderDivider(value) | boolean | No | Whether Slack draws a divider below the header. |
.blockId(value) | string | No | Deterministic identifier, up to 255 characters. |
Validation and errors
.build() materializes nested builders and validates the finished Slack object. It throws a typed slackblocks validation error when a required value is missing, a value has the wrong type or range, mutually exclusive setters are combined, or Slack rejects the resulting shape. Pass { validate: false } to .build() only when intentionally creating an intermediate partial object.
Returns
FluentBuilder<{
blockId?: string;
childBlocks: JsonObject[];
defaultCollapsed?: boolean;
hasHeaderDivider?: boolean;
icon?: JsonObject;
isCollapsible?: boolean;
richTextTitle?: JsonObject;
subtitle?: TextLike;
title?: TextLike;
width?: ContainerWidth;
}, SlackObject<"container">>
ContainerWidth
type ContainerWidth = "narrow" | "standard" | "wide" | "full";
Horizontal width used by a container block.
ContextActionsBlock()
function ContextActionsBlock(): FluentBuilder<{
blockId?: string;
elements: JsonObject[];
}, SlackObject<"context_actions">>;
Creates a fluent row of up to five contextual controls for feedback or compact icon actions. Its elements must be built with FeedbackButtons or IconButton and the block is intended for contextual actions.
See: https://docs.slack.dev/reference/block-kit/blocks/context-actions-block.
Chainable setters
Call these setters in any order before .build(). Repeating a singular setter replaces its previous value.
Collection setters accept individual values, nested builders, or arrays and append each call.
| Setter | Value type | Required | Description |
|---|---|---|---|
.elements(...values) | | Yes | Feedback-buttons or icon-button elements. |
.blockId(value) | string | No | Deterministic identifier, up to 255 characters. |
Validation and errors
.build() materializes nested builders and validates the finished Slack object. It throws a typed slackblocks validation error when a required value is missing, a value has the wrong type or range, mutually exclusive setters are combined, or Slack rejects the resulting shape. Pass { validate: false } to .build() only when intentionally creating an intermediate partial object.
Returns
FluentBuilder<{
blockId?: string;
elements: JsonObject[];
}, SlackObject<"context_actions">>
ContextBlock()
function ContextBlock(): FluentBuilder<{
blockId?: string;
elements: JsonObject[];
}, SlackWire<ContextBlock>>;
Creates a fluent block for compact contextual information beneath or beside
primary content. Add up to ten text objects or image elements with
elements().
See: https://docs.slack.dev/reference/block-kit/blocks/context-block.
Chainable setters
Call these setters in any order before .build(). Repeating a singular setter replaces its previous value.
Collection setters accept individual values, nested builders, or arrays and append each call.
| Setter | Value type | Required | Description |
|---|---|---|---|
.elements(...values) | | Yes | Text objects and image elements. |
.blockId(value) | string | No | Deterministic identifier, up to 255 characters. |
Validation and errors
.build() materializes nested builders and validates the finished Slack object. It throws a typed slackblocks validation error when a required value is missing, a value has the wrong type or range, mutually exclusive setters are combined, or Slack rejects the resulting shape. Pass { validate: false } to .build() only when intentionally creating an intermediate partial object.
Returns
FluentBuilder<{
blockId?: string;
elements: JsonObject[];
}, SlackWire<ContextBlock>>
DataTableBlock()
function DataTableBlock(): FluentBuilder<{
blockId?: string;
caption: string;
pageSize?: number;
rowHeaderColumnIndex?: number;
rows: JsonObject[][];
}, SlackObject<"data_table">>;
Creates a fluent sortable data table containing raw text, raw numbers, or rich
text. The first row supplies the headers and cannot contain rich text; add each
complete row with a separate rows() call.
See: https://docs.slack.dev/reference/block-kit/blocks/data-table-block.
Chainable setters
Call these setters in any order before .build(). Repeating a singular setter replaces its previous value.
Collection setters accept individual values, nested builders, or arrays and append each call.
| Setter | Value type | Required | Description |
|---|---|---|---|
.rows(...values) | | Yes | Two to 201 equally sized rows containing raw text, raw numbers, or rich text. |
.caption(value) | string | Yes | Accessible table caption. |
.pageSize(value) | number | No | Rows per page, between 1 and 100. Defaults to 5. |
.rowHeaderColumnIndex(value) | number | No | Zero-based column used as the row header. Defaults to 0. |
.blockId(value) | string | No | Deterministic identifier, up to 255 characters. |
Validation and errors
.build() materializes nested builders and validates the finished Slack object. It throws a typed slackblocks validation error when a required value is missing, a value has the wrong type or range, mutually exclusive setters are combined, or Slack rejects the resulting shape. Pass { validate: false } to .build() only when intentionally creating an intermediate partial object.
Returns
FluentBuilder<{
blockId?: string;
caption: string;
pageSize?: number;
rowHeaderColumnIndex?: number;
rows: JsonObject[][];
}, SlackObject<"data_table">>
DataVisualizationBlock()
function DataVisualizationBlock(): FluentBuilder<{
blockId?: string;
chart: JsonObject;
title: string;
}, SlackObject<"data_visualization">>;
Creates a fluent data visualization rendered natively by Slack. Set a title and a pie, bar, area, or line chart built with the corresponding composition object builder.
See: https://docs.slack.dev/reference/block-kit/blocks/data-visualization-block.
Chainable setters
Call these setters in any order before .build(). Repeating a singular setter replaces its previous value.
| Setter | Value type | Required | Description |
|---|---|---|---|
.title(value) | string | Yes | Chart heading, up to 50 characters. |
.chart(value) | | Yes | Object returned by PieChart(), BarChart(), AreaChart(), or LineChart(). |
.blockId(value) | string | No | Deterministic identifier, up to 255 characters. |
Validation and errors
.build() materializes nested builders and validates the finished Slack object. It throws a typed slackblocks validation error when a required value is missing, a value has the wrong type or range, mutually exclusive setters are combined, or Slack rejects the resulting shape. Pass { validate: false } to .build() only when intentionally creating an intermediate partial object.
Returns
FluentBuilder<{
blockId?: string;
chart: JsonObject;
title: string;
}, SlackObject<"data_visualization">>
DividerBlock()
function DividerBlock(): FluentBuilder<{
blockId?: string;
}, SlackWire<DividerBlock>>;
Creates a visual divider between adjacent blocks, similar to an HTML <hr>.
The block has no visible content; its only optional field is a deterministic
block identifier.
See: https://docs.slack.dev/reference/block-kit/blocks/divider-block.
Chainable setters
Call these setters in any order before .build(). Repeating a singular setter replaces its previous value.
| Setter | Value type | Required | Description |
|---|---|---|---|
.blockId(value) | string | No | Deterministic identifier, up to 255 characters. |
Validation and errors
.build() materializes nested builders and validates the finished Slack object. It throws a typed slackblocks validation error when a required value is missing, a value has the wrong type or range, mutually exclusive setters are combined, or Slack rejects the resulting shape. Pass { validate: false } to .build() only when intentionally creating an intermediate partial object.
Returns
FluentBuilder<{
blockId?: string;
}, SlackWire<DividerBlock>>
FileBlock()
function FileBlock(): FluentBuilder<{
blockId?: string;
externalId: string;
source?: "remote";
}, SlackWire<FileBlock>>;
Creates a block that displays a remote file already registered with Slack. Supply the external identifier returned by Slack's remote-files API; local or directly uploaded files cannot be embedded with this block.
See: https://docs.slack.dev/reference/block-kit/blocks/file-block.
Chainable setters
Call these setters in any order before .build(). Repeating a singular setter replaces its previous value.
| Setter | Value type | Required | Description |
|---|---|---|---|
.externalId(value) | string | Yes | Identifier assigned when the remote file was added to Slack. |
.source(value) | "remote" | No | Remote-file source. Slack currently accepts only remote. |
.blockId(value) | string | No | Deterministic identifier, up to 255 characters. |
Validation and errors
.build() materializes nested builders and validates the finished Slack object. It throws a typed slackblocks validation error when a required value is missing, a value has the wrong type or range, mutually exclusive setters are combined, or Slack rejects the resulting shape. Pass { validate: false } to .build() only when intentionally creating an intermediate partial object.
Returns
FluentBuilder<{
blockId?: string;
externalId: string;
source?: "remote";
}, SlackWire<FileBlock>>
HeaderBlock()
function HeaderBlock(): FluentBuilder<{
blockId?: string;
text: TextLike;
}, SlackWire<HeaderBlock>>;
Creates a prominent plain-text heading rendered in a larger, bold font. Header text is limited to 150 characters and Slack does not apply mrkdwn formatting.
See: https://docs.slack.dev/reference/block-kit/blocks/header-block.
Chainable setters
Call these setters in any order before .build(). Repeating a singular setter replaces its previous value.
| Setter | Value type | Required | Description |
|---|---|---|---|
.text(value) | | Yes | Heading copy. Strings are converted to plain text. |
.blockId(value) | string | No | Deterministic identifier, up to 255 characters. |
Validation and errors
.build() materializes nested builders and validates the finished Slack object. It throws a typed slackblocks validation error when a required value is missing, a value has the wrong type or range, mutually exclusive setters are combined, or Slack rejects the resulting shape. Pass { validate: false } to .build() only when intentionally creating an intermediate partial object.
Returns
FluentBuilder<{
blockId?: string;
text: TextLike;
}, SlackWire<HeaderBlock>>
ImageBlock()
function ImageBlock(): FluentBuilder<{
altText: string;
blockId?: string;
imageUrl: string;
title?: TextLike;
}, SlackWire<ImageBlock>>;
Creates a block containing one image with accessible alternative text and an optional title. Use ImageElement instead when the image must sit inside a section or context block.
See: https://docs.slack.dev/reference/block-kit/blocks/image-block.
Chainable setters
Call these setters in any order before .build(). Repeating a singular setter replaces its previous value.
| Setter | Value type | Required | Description |
|---|---|---|---|
.imageUrl(value) | string | Yes | Public URL of the image. |
.altText(value) | string | Yes | Accessible description of the image. |
.title(value) | | No | Optional plain-text title. |
.blockId(value) | string | No | Deterministic identifier, up to 255 characters. |
Validation and errors
.build() materializes nested builders and validates the finished Slack object. It throws a typed slackblocks validation error when a required value is missing, a value has the wrong type or range, mutually exclusive setters are combined, or Slack rejects the resulting shape. Pass { validate: false } to .build() only when intentionally creating an intermediate partial object.
Returns
FluentBuilder<{
altText: string;
blockId?: string;
imageUrl: string;
title?: TextLike;
}, SlackWire<ImageBlock>>
InputBlock()
function InputBlock(): FluentBuilder<{
blockId?: string;
dispatchAction?: boolean;
element: JsonObject;
hint?: TextLike;
label: TextLike;
optional?: boolean;
}, SlackWire<InputBlock>>;
Creates a labelled form control for collecting information in a modal or App Home view. Set the required label and one supported input element, then optionally add a hint, allow omission, or dispatch changes immediately.
See: https://docs.slack.dev/reference/block-kit/blocks/input-block.
Chainable setters
Call these setters in any order before .build(). Repeating a singular setter replaces its previous value.
| Setter | Value type | Required | Description |
|---|---|---|---|
.label(value) | | Yes | Plain-text label displayed above the control. |
.element(value) | | Yes | Input-compatible element such as a text input, picker, or select menu. |
.dispatchAction(value) | boolean | No | Whether changes dispatch an interaction immediately. |
.blockId(value) | string | No | Deterministic identifier, up to 255 characters. |
.hint(value) | | No | Optional plain-text help shown below the control. |
.optional(value) | boolean | No | Whether the user may submit without completing this input. |
Validation and errors
.build() materializes nested builders and validates the finished Slack object. It throws a typed slackblocks validation error when a required value is missing, a value has the wrong type or range, mutually exclusive setters are combined, or Slack rejects the resulting shape. Pass { validate: false } to .build() only when intentionally creating an intermediate partial object.
Returns
FluentBuilder<{
blockId?: string;
dispatchAction?: boolean;
element: JsonObject;
hint?: TextLike;
label: TextLike;
optional?: boolean;
}, SlackWire<InputBlock>>
MarkdownBlock()
function MarkdownBlock(): FluentBuilder<{
blockId?: string;
text: string;
}, SlackWire<MarkdownBlock>>;
Creates a block rendered with GitHub-flavored Markdown, including tables and
fenced code blocks. This differs from Slack mrkdwn used by section text and
is intended for richer AI or agent-generated output.
See: https://docs.slack.dev/reference/block-kit/blocks/markdown-block.
Chainable setters
Call these setters in any order before .build(). Repeating a singular setter replaces its previous value.
| Setter | Value type | Required | Description |
|---|---|---|---|
.text(value) | string | Yes | GitHub-flavored Markdown source. |
.blockId(value) | string | No | Deterministic identifier, up to 255 characters. |
Validation and errors
.build() materializes nested builders and validates the finished Slack object. It throws a typed slackblocks validation error when a required value is missing, a value has the wrong type or range, mutually exclusive setters are combined, or Slack rejects the resulting shape. Pass { validate: false } to .build() only when intentionally creating an intermediate partial object.
Returns
FluentBuilder<{
blockId?: string;
text: string;
}, SlackWire<MarkdownBlock>>
PlanBlock()
function PlanBlock(): FluentBuilder<{
blockId?: string;
tasks?: JsonObject[];
title: string;
}, SlackObject<"plan">>;
Creates a fluent titled sequence of task cards. Add tasks with tasks() using
built task cards, TaskCardBlock builders, or arrays containing either
form.
See: https://docs.slack.dev/reference/block-kit/blocks/plan-block.
Chainable setters
Call these setters in any order before .build(). Repeating a singular setter replaces its previous value.
Collection setters accept individual values, nested builders, or arrays and append each call.
| Setter | Value type | Required | Description |
|---|---|---|---|
.title(value) | string | Yes | Human-readable plan title. |
.tasks(...values) | | No | Task-card blocks. Their outer type and block_id fields are omitted in the plan. |
.blockId(value) | string | No | Deterministic identifier, up to 255 characters. |
Validation and errors
.build() materializes nested builders and validates the finished Slack object. It throws a typed slackblocks validation error when a required value is missing, a value has the wrong type or range, mutually exclusive setters are combined, or Slack rejects the resulting shape. Pass { validate: false } to .build() only when intentionally creating an intermediate partial object.
Returns
FluentBuilder<{
blockId?: string;
tasks?: JsonObject[];
title: string;
}, SlackObject<"plan">>
RichTextBlock()
function RichTextBlock(): FluentBuilder<{
blockId?: string;
elements: JsonObject[];
}, SlackWire<RichTextBlock>>;
Creates a rich-text block from Slack's structured rich-text sections, lists,
code blocks, and quotes. Use it when text needs formatting or nesting that is
unavailable through ordinary section mrkdwn.
See: https://docs.slack.dev/reference/block-kit/blocks/rich-text-block.
Chainable setters
Call these setters in any order before .build(). Repeating a singular setter replaces its previous value.
Collection setters accept individual values, nested builders, or arrays and append each call.
| Setter | Value type | Required | Description |
|---|---|---|---|
.elements(...values) | | Yes | Rich-text layout objects. |
.blockId(value) | string | No | Deterministic identifier, up to 255 characters. |
Validation and errors
.build() materializes nested builders and validates the finished Slack object. It throws a typed slackblocks validation error when a required value is missing, a value has the wrong type or range, mutually exclusive setters are combined, or Slack rejects the resulting shape. Pass { validate: false } to .build() only when intentionally creating an intermediate partial object.
Returns
FluentBuilder<{
blockId?: string;
elements: JsonObject[];
}, SlackWire<RichTextBlock>>
SectionBlock()
function SectionBlock(): FluentBuilder<SectionBlockInput, SlackWire<SectionBlock>>;
Creates one of Block Kit's most flexible blocks: a section can show main text,
arrange short fields into columns, and display an interactive or visual
accessory beside the content. Set at least text() or fields().
See: https://docs.slack.dev/reference/block-kit/blocks/section-block.
Chainable setters
Call these setters in any order before .build(). Repeating a singular setter replaces its previous value.
Collection setters accept individual values, nested builders, or arrays and append each call.
| Setter | Value type | Required | Description |
|---|---|---|---|
.text(value) | | No | Main copy. Strings are converted to mrkdwn text. |
.blockId(value) | string | No | Deterministic identifier, up to 255 characters. |
.fields(...values) | | No | Up to ten text fields displayed in columns. |
.accessory(value) | | No | Optional interactive or visual element displayed beside the text. |
Validation and errors
.build() materializes nested builders and validates the finished Slack object. It throws a typed slackblocks validation error when a required value is missing, a value has the wrong type or range, mutually exclusive setters are combined, or Slack rejects the resulting shape. Pass { validate: false } to .build() only when intentionally creating an intermediate partial object.
Returns
FluentBuilder<SectionBlockInput, SlackWire<SectionBlock>>
SectionBlockInput
Text, field, accessory, and identity fields configured by SectionBlock().
Every section must contain main text, one or more fields, or both.
Properties
| Property | Type | Description |
|---|---|---|
accessory? | JsonObject | Optional interactive or visual element displayed beside the text. |
blockId? | string | Deterministic identifier, up to 255 characters. |
fields? | TextLike[] | Up to ten text fields displayed in columns. |
text? | TextLike | Main copy. Strings are converted to mrkdwn text. |
TableBlock()
function TableBlock(): FluentBuilder<{
blockId?: string;
columnSettings?: JsonObject[];
rows: JsonObject[][];
}, SlackWire<TableBlock>>;
Creates a table block for structured rows and optional column display settings.
Add each complete row with a separate rows() call so nested cell arrays retain
their row boundaries.
See: https://docs.slack.dev/reference/block-kit/blocks/table-block.
Chainable setters
Call these setters in any order before .build(). Repeating a singular setter replaces its previous value.
Collection setters accept individual values, nested builders, or arrays and append each call.
| Setter | Value type | Required | Description |
|---|---|---|---|
.rows(...values) | | Yes | Up to 100 equally sized rows of raw-text or rich-text cells. |
.columnSettings(...values) | | No | Optional display settings for each column. |
.blockId(value) | string | No | Deterministic identifier, up to 255 characters. |
Validation and errors
.build() materializes nested builders and validates the finished Slack object. It throws a typed slackblocks validation error when a required value is missing, a value has the wrong type or range, mutually exclusive setters are combined, or Slack rejects the resulting shape. Pass { validate: false } to .build() only when intentionally creating an intermediate partial object.
Returns
FluentBuilder<{
blockId?: string;
columnSettings?: JsonObject[];
rows: JsonObject[][];
}, SlackWire<TableBlock>>
TaskCardBlock()
function TaskCardBlock(): FluentBuilder<{
blockId?: string;
details?: JsonObject;
output?: JsonObject;
sources?: JsonObject[];
status?: TaskStatus;
taskId: string;
title: string;
}, SlackObject<"task_card">>;
Creates a fluent task card containing a stable identifier, title, lifecycle state, rich-text details or output, and source links. Task cards may stand alone or be collected in a PlanBlock.
See: https://docs.slack.dev/reference/block-kit/blocks/task-card-block.
Chainable setters
Call these setters in any order before .build(). Repeating a singular setter replaces its previous value.
Collection setters accept individual values, nested builders, or arrays and append each call.
| Setter | Value type | Required | Description |
|---|---|---|---|
.taskId(value) | string | Yes | Stable task identifier. |
.title(value) | string | Yes | Human-readable task title. |
.details(value) | | No | Optional rich-text task details. |
.output(value) | | No | Optional rich-text task output. |
.sources(...values) | | No | Optional source links created with UrlSource(). |
.status(value) | | No | Current task lifecycle state. |
.blockId(value) | string | No | Deterministic identifier, up to 255 characters. |
Validation and errors
.build() materializes nested builders and validates the finished Slack object. It throws a typed slackblocks validation error when a required value is missing, a value has the wrong type or range, mutually exclusive setters are combined, or Slack rejects the resulting shape. Pass { validate: false } to .build() only when intentionally creating an intermediate partial object.
Returns
FluentBuilder<{
blockId?: string;
details?: JsonObject;
output?: JsonObject;
sources?: JsonObject[];
status?: TaskStatus;
taskId: string;
title: string;
}, SlackObject<"task_card">>
TaskStatus
type TaskStatus = "pending" | "in_progress" | "complete" | "error";
Lifecycle state shown by a task card.
VideoBlock()
function VideoBlock(): FluentBuilder<{
altText: string;
authorName?: string;
blockId?: string;
description?: TextLike;
providerIconUrl?: string;
providerName?: string;
thumbnailUrl: string;
title: TextLike;
titleUrl?: string;
videoUrl: string;
}, SlackWire<VideoBlock>>;
Creates a block that embeds video content in a message, modal, or App Home tab. Slack enforces its own provider allow-list when accepting the payload, so an unsupported video URL can still produce a Slack API error after local validation.
See: https://docs.slack.dev/reference/block-kit/blocks/video-block.
Chainable setters
Call these setters in any order before .build(). Repeating a singular setter replaces its previous value.
| Setter | Value type | Required | Description |
|---|---|---|---|
.altText(value) | string | Yes | Accessible summary, up to 200 characters. |
.thumbnailUrl(value) | string | Yes | Public preview-image URL. |
.title(value) | | Yes | Plain-text video title, up to 200 characters. |
.videoUrl(value) | string | Yes | URL of a video hosted by a Slack-supported provider. |
.blockId(value) | string | No | Deterministic identifier, up to 255 characters. |
.authorName(value) | string | No | Optional author name, up to 50 characters. |
.description(value) | | No | Optional plain-text description, up to 200 characters. |
.providerIconUrl(value) | string | No | Optional provider icon URL. |
.providerName(value) | string | No | Optional provider name, up to 50 characters. |
.titleUrl(value) | string | No | Optional destination when the title is selected. |
Validation and errors
.build() materializes nested builders and validates the finished Slack object. It throws a typed slackblocks validation error when a required value is missing, a value has the wrong type or range, mutually exclusive setters are combined, or Slack rejects the resulting shape. Pass { validate: false } to .build() only when intentionally creating an intermediate partial object.
Returns
FluentBuilder<{
altText: string;
authorName?: string;
blockId?: string;
description?: TextLike;
providerIconUrl?: string;
providerName?: string;
thumbnailUrl: string;
title: TextLike;
titleUrl?: string;
videoUrl: string;
}, SlackWire<VideoBlock>>