Skip to main content

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.

SetterValue typeRequiredDescription
.elements(...values)
JsonObject[]
YesInteractive elements displayed in the row.
.blockId(value)stringNoDeterministic 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.

SetterValue typeRequiredDescription
.text(value)
TextLike
YesAlert copy. Strings are converted to mrkdwn text.
.level(value)
AlertLevel
NoVisual severity. Defaults to default.
.blockId(value)stringNoDeterministic 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.

SetterValue typeRequiredDescription
.heroImage(value)
JsonObject
NoLarge image displayed above the card content.
.icon(value)
JsonObject
NoSmall image displayed beside the card heading.
.title(value)
TextLike
NoPrimary heading, up to 150 characters.
.subtitle(value)
TextLike
NoSecondary heading, up to 150 characters.
.body(value)
TextLike
NoMain card copy, up to 200 characters.
.actions(...values)
JsonObject[]
NoUp to three button actions.
.slackIcon(value)
JsonObject
NoSlack-hosted icon created with SlackIcon().
.subtext(value)
TextLike
NoSupporting copy displayed below the body.
.blockId(value)stringNoDeterministic 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

PropertyTypeDescription
actions?JsonObject[]Up to three button actions.
blockId?stringDeterministic identifier, up to 255 characters.
body?TextLikeMain card copy, up to 200 characters.
heroImage?JsonObjectLarge image displayed above the card content.
icon?JsonObjectSmall image displayed beside the card heading.
slackIcon?JsonObjectSlack-hosted icon created with slackIcon.
subtext?TextLikeSupporting copy displayed below the body.
subtitle?TextLikeSecondary heading, up to 150 characters.
title?TextLikePrimary 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.

SetterValue typeRequiredDescription
.elements(...values)
JsonObject[]
YesBetween one and ten objects returned by CardBlock().
.blockId(value)stringNoDeterministic 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.

SetterValue typeRequiredDescription
.childBlocks(...values)
JsonObject[]
YesUp to ten blocks supported by Slack containers.
.title(value)
TextLike
NoPlain-text title. Mutually exclusive with richTextTitle.
.richTextTitle(value)
JsonObject
NoRich-text title block. Mutually exclusive with title.
.subtitle(value)
TextLike
NoOptional supporting copy below the title.
.width(value)
ContainerWidth
NoContainer width. Defaults to standard.
.icon(value)
JsonObject
NoOptional image displayed in the header.
.isCollapsible(value)booleanNoWhether readers can expand and collapse the container.
.defaultCollapsed(value)booleanNoWhether a collapsible container starts collapsed.
.hasHeaderDivider(value)booleanNoWhether Slack draws a divider below the header.
.blockId(value)stringNoDeterministic 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.

SetterValue typeRequiredDescription
.elements(...values)
JsonObject[]
YesFeedback-buttons or icon-button elements.
.blockId(value)stringNoDeterministic 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.

SetterValue typeRequiredDescription
.elements(...values)
JsonObject[]
YesText objects and image elements.
.blockId(value)stringNoDeterministic 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.

SetterValue typeRequiredDescription
.rows(...values)
JsonObject[][]
YesTwo to 201 equally sized rows containing raw text, raw numbers, or rich text.
.caption(value)stringYesAccessible table caption.
.pageSize(value)numberNoRows per page, between 1 and 100. Defaults to 5.
.rowHeaderColumnIndex(value)numberNoZero-based column used as the row header. Defaults to 0.
.blockId(value)stringNoDeterministic 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.

SetterValue typeRequiredDescription
.title(value)stringYesChart heading, up to 50 characters.
.chart(value)
JsonObject
YesObject returned by PieChart(), BarChart(), AreaChart(), or LineChart().
.blockId(value)stringNoDeterministic 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.

SetterValue typeRequiredDescription
.blockId(value)stringNoDeterministic 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.

SetterValue typeRequiredDescription
.externalId(value)stringYesIdentifier assigned when the remote file was added to Slack.
.source(value)"remote"NoRemote-file source. Slack currently accepts only remote.
.blockId(value)stringNoDeterministic 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.

SetterValue typeRequiredDescription
.text(value)
TextLike
YesHeading copy. Strings are converted to plain text.
.blockId(value)stringNoDeterministic 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.

SetterValue typeRequiredDescription
.imageUrl(value)stringYesPublic URL of the image.
.altText(value)stringYesAccessible description of the image.
.title(value)
TextLike
NoOptional plain-text title.
.blockId(value)stringNoDeterministic 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.

SetterValue typeRequiredDescription
.label(value)
TextLike
YesPlain-text label displayed above the control.
.element(value)
JsonObject
YesInput-compatible element such as a text input, picker, or select menu.
.dispatchAction(value)booleanNoWhether changes dispatch an interaction immediately.
.blockId(value)stringNoDeterministic identifier, up to 255 characters.
.hint(value)
TextLike
NoOptional plain-text help shown below the control.
.optional(value)booleanNoWhether 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.

SetterValue typeRequiredDescription
.text(value)stringYesGitHub-flavored Markdown source.
.blockId(value)stringNoDeterministic 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.

SetterValue typeRequiredDescription
.title(value)stringYesHuman-readable plan title.
.tasks(...values)
JsonObject[]
NoTask-card blocks. Their outer type and block_id fields are omitted in the plan.
.blockId(value)stringNoDeterministic 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.

SetterValue typeRequiredDescription
.elements(...values)
JsonObject[]
YesRich-text layout objects.
.blockId(value)stringNoDeterministic 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.

SetterValue typeRequiredDescription
.text(value)
TextLike
NoMain copy. Strings are converted to mrkdwn text.
.blockId(value)stringNoDeterministic identifier, up to 255 characters.
.fields(...values)
TextLike[]
NoUp to ten text fields displayed in columns.
.accessory(value)
JsonObject
NoOptional 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

PropertyTypeDescription
accessory?JsonObjectOptional interactive or visual element displayed beside the text.
blockId?stringDeterministic identifier, up to 255 characters.
fields?TextLike[]Up to ten text fields displayed in columns.
text?TextLikeMain 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.

SetterValue typeRequiredDescription
.rows(...values)
JsonObject[][]
YesUp to 100 equally sized rows of raw-text or rich-text cells.
.columnSettings(...values)
JsonObject[]
NoOptional display settings for each column.
.blockId(value)stringNoDeterministic 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.

SetterValue typeRequiredDescription
.taskId(value)stringYesStable task identifier.
.title(value)stringYesHuman-readable task title.
.details(value)
JsonObject
NoOptional rich-text task details.
.output(value)
JsonObject
NoOptional rich-text task output.
.sources(...values)
JsonObject[]
NoOptional source links created with UrlSource().
.status(value)
TaskStatus
NoCurrent task lifecycle state.
.blockId(value)stringNoDeterministic 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.

SetterValue typeRequiredDescription
.altText(value)stringYesAccessible summary, up to 200 characters.
.thumbnailUrl(value)stringYesPublic preview-image URL.
.title(value)
TextLike
YesPlain-text video title, up to 200 characters.
.videoUrl(value)stringYesURL of a video hosted by a Slack-supported provider.
.blockId(value)stringNoDeterministic identifier, up to 255 characters.
.authorName(value)stringNoOptional author name, up to 50 characters.
.description(value)
TextLike
NoOptional plain-text description, up to 200 characters.
.providerIconUrl(value)stringNoOptional provider icon URL.
.providerName(value)stringNoOptional provider name, up to 50 characters.
.titleUrl(value)stringNoOptional 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>>