Skip to main content

Composition Objects

Fluent builders for reusable composition objects nested inside blocks and elements. This includes text, selectable options, confirmation dialogs, files, workflow metadata, rich text, table cells, and chart data.

See: https://docs.slack.dev/reference/block-kit/composition-objects.

AreaChart()

function AreaChart(): FluentBuilder<AxisChartBuilderInput, SlackObject<"area">>;

Creates a layered area chart for a data visualization block. Supply one or more named series and an axis configuration whose categories match every point in those series.

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. Collection setters accept individual values, nested builders, or arrays and append each call.

SetterValue typeRequiredDescription
.series(...values)
JsonObject[]
YesOne or more named data series to plot.
.axisConfig(value)
JsonObject
YesAxis labels and category configuration.

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<AxisChartBuilderInput, SlackObject<"area">>


AxisConfig()

function AxisConfig(): FluentBuilder<AxisConfigInput, JsonObject>;

Creates category labels and optional axis titles for a bar, area, or line chart. Categories must be unique and match the labels represented in every data series.

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. Collection setters accept individual values, nested builders, or arrays and append each call.

SetterValue typeRequiredDescription
.categories(...values)string[]YesUnique category labels, in display order.
.xLabel(value)stringNoOptional horizontal-axis label, up to 50 characters.
.yLabel(value)stringNoOptional vertical-axis label, up to 50 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<AxisConfigInput, JsonObject>


AxisConfigInput

Ordered unique categories and optional axis titles shared by every series in an axis- based chart.

Properties

PropertyTypeDescription
categoriesstring[]Unique category labels, in display order.
xLabel?stringOptional horizontal-axis label, up to 50 characters.
yLabel?stringOptional vertical-axis label, up to 50 characters.

BarChart()

function BarChart(): FluentBuilder<AxisChartBuilderInput, SlackObject<"bar">>;

Creates a grouped bar chart for a data visualization block. Supply one or more named series and an axis configuration whose categories match every point in those series.

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. Collection setters accept individual values, nested builders, or arrays and append each call.

SetterValue typeRequiredDescription
.series(...values)
JsonObject[]
YesOne or more named data series to plot.
.axisConfig(value)
JsonObject
YesAxis labels and category configuration.

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<AxisChartBuilderInput, SlackObject<"bar">>


ChartSegment()

function ChartSegment(): FluentBuilder<ChartSegmentInput, JsonObject>;

Creates one labelled, positive-valued segment in a pie chart. Segment labels are limited to 20 characters and each value must be a finite number greater than zero.

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
.label(value)stringYesSegment label, up to 20 characters.
.value(value)numberYesPositive finite segment value.

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<ChartSegmentInput, JsonObject>


ChartSegmentInput

Label and positive finite value for one segment in a Slack-rendered pie chart.

Properties

PropertyTypeDescription
labelstringSegment label, up to 20 characters.
valuenumberPositive finite segment value.

ColumnSettings()

function ColumnSettings(): FluentBuilder<{
align?: "left" | "center" | "right";
isWrapped?: boolean;
}, JsonObject>;

Creates display settings for one column in a table block. Configure horizontal alignment and whether long cell content should wrap within the column.

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.

SetterValue typeRequiredDescription
.align(value)"left" | "center" | "right"NoHorizontal cell alignment.
.isWrapped(value)booleanNoWhether long cell content wraps.

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<{ align?: "left" | "center" | "right"; isWrapped?: boolean; }, JsonObject>


Confirmation()

function Confirmation(): FluentBuilder<ConfirmationInput, JsonObject>;

Creates a confirmation dialog that asks a user to approve or cancel an interactive action. Configure its title, explanatory text, and the labels on both the confirm and deny buttons.

See: https://docs.slack.dev/reference/block-kit/composition-objects/confirmation-dialog-object.

Chainable setters

Call these setters in any order before .build(). Repeating a singular setter replaces its previous value.

SetterValue typeRequiredDescription
.title(value)
TextLike
YesPlain-text dialog title, up to 100 characters.
.text(value)
TextLike
YesConfirmation question, up to 300 characters.
.confirm(value)
TextLike
YesPlain-text confirm-button label, up to 30 characters.
.deny(value)
TextLike
YesPlain-text cancel-button label, up to 30 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<ConfirmationInput, JsonObject>


ConfirmationInput

Text and button labels required to present a confirmation step before an interactive action is submitted.

Properties

PropertyTypeDescription
confirmTextLikePlain-text confirm-button label, up to 30 characters.
denyTextLikePlain-text cancel-button label, up to 30 characters.
textTextLikeConfirmation question, up to 300 characters.
titleTextLikePlain-text dialog title, up to 100 characters.

ConversationFilter()

function ConversationFilter(): FluentBuilder<{
excludeBotUsers?: boolean;
excludeExternalSharedChannels?: boolean;
include?: string[];
}, JsonObject>;

Creates a filter for conversation single-select and multi-select elements. Include selected conversation kinds and optionally exclude externally shared channels or direct messages with bots; at least one filter field is required.

See: https://docs.slack.dev/reference/block-kit/composition-objects/conversation-filter-object.

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
.include(...values)string[]NoConversation kinds to include, such as im, mpim, private, or public.
.excludeExternalSharedChannels(value)booleanNoExclude externally shared conversations.
.excludeBotUsers(value)booleanNoExclude direct messages with bots.

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<{ excludeBotUsers?: boolean; excludeExternalSharedChannels?: boolean; include?: string[]; }, JsonObject>


DataPoint()

function DataPoint(): FluentBuilder<DataPointInput, JsonObject>;

Creates one labelled numeric point in a bar, area, or line chart series. Its label must correspond to one of the chart's axis categories and its value must be finite.

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
.label(value)stringYesCategory label, up to 20 characters.
.value(value)numberYesFinite numeric value.

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<DataPointInput, JsonObject>


DataPointInput

Category label and finite numeric value for one point in an axis-based chart series.

Properties

PropertyTypeDescription
labelstringCategory label, up to 20 characters.
valuenumberFinite numeric value.

DataSeries()

function DataSeries(): FluentBuilder<DataSeriesInput, JsonObject>;

Creates a named series containing between one and 20 data points for a bar, area, or line chart. Add points in display order with repeated data() calls.

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. Collection setters accept individual values, nested builders, or arrays and append each call.

SetterValue typeRequiredDescription
.name(value)stringYesUnique series name, up to 20 characters.
.data(...values)
JsonObject[]
YesBetween one and 20 points created with DataPoint().

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<DataSeriesInput, JsonObject>


DataSeriesInput

Unique name and ordered data points for one series in a bar, area, or line chart.

Properties

PropertyTypeDescription
dataJsonObject[]Between one and 20 points created with dataPoint.
namestringUnique series name, up to 20 characters.

DispatchActionConfiguration()

function DispatchActionConfiguration(): FluentBuilder<{
triggerActionsOn: string[];
}, JsonObject>;

Creates a dispatch-action configuration for an input element. Select the input events, such as Enter being pressed or a character being entered, that should immediately send a block_actions payload to the application.

See: https://docs.slack.dev/reference/block-kit/composition-objects/dispatch-action-configuration-object.

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
.triggerActionsOn(...values)string[]YesEvents such as on_enter_pressed or on_character_entered.

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<{ triggerActionsOn: string[]; }, JsonObject>


InputParameter()

function InputParameter(): FluentBuilder<{
name: string;
value: string;
}, JsonObject>;

Creates one customizable input parameter passed to a Slack workflow trigger. The parameter name must match an input defined by the workflow, and its value is supplied when the workflow button is used.

See: https://docs.slack.dev/reference/block-kit/composition-objects/workflow-object.

Chainable setters

Call these setters in any order before .build(). Repeating a singular setter replaces its previous value.

SetterValue typeRequiredDescription
.name(value)stringYesWorkflow parameter name.
.value(value)stringYesValue passed to the workflow.

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<{ name: string; value: string; }, JsonObject>


LineChart()

function LineChart(): FluentBuilder<AxisChartBuilderInput, SlackObject<"line">>;

Creates a line chart for a data visualization block. Supply one or more named series and an axis configuration whose categories match every point in those series.

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. Collection setters accept individual values, nested builders, or arrays and append each call.

SetterValue typeRequiredDescription
.series(...values)
JsonObject[]
YesOne or more named data series to plot.
.axisConfig(value)
JsonObject
YesAxis labels and category configuration.

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<AxisChartBuilderInput, SlackObject<"line">>


Markdown()

function Markdown(): FluentBuilder<MarkdownBuilderInput, TextObject>;

Creates a text composition object rendered with Slack's mrkdwn syntax. Use verbatim() when links, mentions, and other tokens should remain literal rather than being parsed automatically.

See: https://docs.slack.dev/reference/block-kit/composition-objects/text-object.

Chainable setters

Call these setters in any order before .build(). Repeating a singular setter replaces its previous value.

SetterValue typeRequiredDescription
.text(value)stringYesSlack mrkdwn text to display.
.verbatim(value)booleanNoWhether Slack should treat the text literally instead of auto-parsing links and mentions.

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<MarkdownBuilderInput, TextObject>


MarkdownOptions

Optional parsing behavior for a mrkdwn text object, controlling automatic links and mentions.

Properties

PropertyTypeDescription
verbatim?booleanWhether Slack should treat the text literally instead of auto-parsing links and mentions.

Option()

function Option(): FluentBuilder<OptionInput, JsonObject>;

Creates one selectable item for a select menu, multi-select menu, checkbox group, radio-button group, or overflow menu. The application-defined value is returned when the user chooses the option.

See: https://docs.slack.dev/reference/block-kit/composition-objects/option-object.

Chainable setters

Call these setters in any order before .build(). Repeating a singular setter replaces its previous value.

SetterValue typeRequiredDescription
.text(value)
TextLike
YesPlain-text option label, up to 75 characters.
.value(value)stringYesApplication-defined value, up to 150 characters.
.description(value)
TextLike
NoOptional plain-text supporting copy, up to 75 characters.
.url(value)stringNoOptional destination URL for overflow menus.

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<OptionInput, JsonObject>


OptionGroup()

function OptionGroup(): FluentBuilder<OptionGroupInput, JsonObject>;

Creates a labelled group containing between one and 100 selectable options. Option groups can organize choices in static single-select and multi-select menus.

See: https://docs.slack.dev/reference/block-kit/composition-objects/option-group-object.

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
.label(value)
TextLike
YesPlain-text group label, up to 75 characters.
.options(...values)
JsonObject[]
YesBetween one and 100 option objects.

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<OptionGroupInput, JsonObject>


OptionGroupInput

Label and choices for a group of between one and 100 options in a static select menu.

Properties

PropertyTypeDescription
labelTextLikePlain-text group label, up to 75 characters.
optionsJsonObject[]Between one and 100 option objects.

OptionInput

Label, returned value, and optional supporting content for one selectable option.

Properties

PropertyTypeDescription
description?TextLikeOptional plain-text supporting copy, up to 75 characters.
textTextLikePlain-text option label, up to 75 characters.
url?stringOptional destination URL for overflow menus.
valuestringApplication-defined value, up to 150 characters.

PieChart()

function PieChart(): FluentBuilder<{
segments: JsonObject[];
}, SlackObject<"pie">>;

Creates a pie chart containing between one and 12 labelled segments for a data visualization block. Add built segments or ChartSegment builders with repeated segments() calls.

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. Collection setters accept individual values, nested builders, or arrays and append each call.

SetterValue typeRequiredDescription
.segments(...values)
JsonObject[]
Yes

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<{ segments: JsonObject[]; }, SlackObject<"pie">>


PlainText()

function PlainText(): FluentBuilder<PlainTextBuilderInput, TextObject>;

Creates a plain-text composition object with no Slack formatting. Use it for labels and other fields that require plain_text; emoji shortcodes can be converted by enabling the optional emoji setting.

See: https://docs.slack.dev/reference/block-kit/composition-objects/text-object.

Chainable setters

Call these setters in any order before .build(). Repeating a singular setter replaces its previous value.

SetterValue typeRequiredDescription
.text(value)stringYesText to display.
.emoji(value)booleanNoWhether Slack should render emoji shortcodes.

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<PlainTextBuilderInput, TextObject>


PlainTextOptions

Optional rendering behavior for a plain-text object, controlling whether Slack expands emoji shortcodes.

Properties

PropertyTypeDescription
emoji?booleanWhether Slack should render emoji shortcodes.

RawNumber()

function RawNumber(): FluentBuilder<{
text: string;
value: number;
}, SlackObject<"raw_number">>;

Creates a numeric data-table cell with separate machine-sortable and human-readable values. The numeric value must be finite, while text() controls what Slack displays to the reader.

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.

SetterValue typeRequiredDescription
.value(value)numberYes
.text(value)stringYes

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<{ text: string; value: number; }, SlackObject<"raw_number">>


RawText()

function RawText(): FluentBuilder<{
text: string;
}, SlackObject<"raw_text">>;

Creates an unformatted raw_text cell for a table or data table. Slack displays the supplied text literally, without applying mrkdwn or rich-text formatting.

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.

SetterValue typeRequiredDescription
.text(value)stringYes

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<{ text: string; }, SlackObject<"raw_text">>


RichText()

function RichText(): FluentBuilder<RichTextBuilderInput, JsonObject>;

Creates the core text run used by Slack's structured rich-text API. Apply bold, italic, strikethrough, or code styling and place the result inside a rich-text section, list, code block, or quote.

See: https://docs.slack.dev/reference/block-kit/blocks/rich-text-block#text-element-type.

Chainable setters

Call these setters in any order before .build(). Repeating a singular setter replaces its previous value.

SetterValue typeRequiredDescription
.text(value)stringYesText content for this run.
.style(value)
RichTextStyle
NoOptional Slack rich-text styling.

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<RichTextBuilderInput, JsonObject>


RichTextChannel()

function RichTextChannel(): FluentBuilder<RichTextMentionBuilderInput, JsonObject>;

Creates a structured rich-text mention for a Slack channel, such as #general. Slack resolves the supplied channel ID when rendering the containing rich-text block.

See: https://docs.slack.dev/reference/block-kit/blocks/rich-text-block#channel-element-type.

Chainable setters

Call these setters in any order before .build(). Repeating a singular setter replaces its previous value.

SetterValue typeRequiredDescription
.id(value)stringYesSlack channel, user, or user-group identifier.
.style(value)
RichTextStyle
NoOptional Slack rich-text styling.

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<RichTextMentionBuilderInput, JsonObject>


RichTextCodeBlock()

function RichTextCodeBlock(): FluentBuilder<RichTextLayoutBuilderInput, JsonObject>;

Creates a preformatted rich-text code block, roughly equivalent to a fenced code block in Markdown. Add structured rich-text elements as its content and optionally configure the surrounding border.

See: https://docs.slack.dev/reference/block-kit/blocks/rich-text-block#rich_text_preformatted.

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 elements displayed inside the layout.
.border(value)numberNoOptional border width.

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<RichTextLayoutBuilderInput, JsonObject>


RichTextEmoji()

function RichTextEmoji(): FluentBuilder<{
name: string;
}, JsonObject>;

Creates a structured rich-text emoji using a built-in Slack name or a custom workspace emoji name. Supply the name without surrounding colon characters.

See: https://docs.slack.dev/reference/block-kit/blocks/rich-text-block#emoji-element-type.

Chainable setters

Call these setters in any order before .build(). Repeating a singular setter replaces its previous value.

SetterValue typeRequiredDescription
.name(value)stringYes

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<{ name: string; }, JsonObject>


function RichTextLink(): FluentBuilder<{
style?: RichTextStyle;
text?: string;
unsafe?: boolean;
url: string;
}, JsonObject>;

Creates a structured rich-text link with a destination URL and optional display text or style. When text is omitted, Slack displays the URL itself.

See: https://docs.slack.dev/reference/block-kit/blocks/rich-text-block#link-element-type.

Chainable setters

Call these setters in any order before .build(). Repeating a singular setter replaces its previous value.

SetterValue typeRequiredDescription
.url(value)stringYesDestination URL.
.text(value)stringNoOptional visible label. Slack displays the URL when omitted.
.unsafe(value)booleanNoMark a URL as unsafe when mirroring a Slack-provided payload.
.style(value)
RichTextStyle
NoOptional inline formatting.

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<{ style?: RichTextStyle; text?: string; unsafe?: boolean; url: string; }, JsonObject>


RichTextList()

function RichTextList(): FluentBuilder<{
border?: number;
elements: JsonObject[];
indent?: number;
offset?: number;
style: "bullet" | "ordered";
}, JsonObject>;

Creates an ordered or bulleted list of rich-text sections. Configure indentation and list style, then add each section with elements() in display order.

See: https://docs.slack.dev/reference/block-kit/blocks/rich-text-block#rich_text_list.

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 section objects used as list items.
.style(value)"bullet" | "ordered"YesList marker style.
.indent(value)numberNoNesting depth.
.offset(value)numberNoStarting number for an ordered list.
.border(value)numberNoOptional border thickness.

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<{ border?: number; elements: JsonObject[]; indent?: number; offset?: number; style: "bullet" | "ordered"; }, JsonObject>


RichTextQuote()

function RichTextQuote(): FluentBuilder<RichTextLayoutBuilderInput, JsonObject>;

Creates a rich-text quotation rendered with a vertical bar beside its content. Add structured rich-text elements in display order and optionally configure the surrounding border.

See: https://docs.slack.dev/reference/block-kit/blocks/rich-text-block#rich_text_quote.

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 elements displayed inside the layout.
.border(value)numberNoOptional border width.

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<RichTextLayoutBuilderInput, JsonObject>


RichTextSection()

function RichTextSection(): FluentBuilder<{
elements: JsonObject[];
}, JsonObject>;

Creates the basic paragraph-like container for structured rich-text elements. Add text runs, links, emoji, and mentions with elements() before placing the section in a rich-text block or higher-level rich-text layout.

See: https://docs.slack.dev/reference/block-kit/blocks/rich-text-block#rich_text_section.

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[]
Yes

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<{ elements: JsonObject[]; }, JsonObject>


RichTextStyle

Inline formatting supported by rich-text text, links, users, and channels.

Properties

PropertyTypeDescription
bold?booleanRender the inline content in bold.
code?booleanRender the inline content as code.
italic?booleanRender the inline content in italics.
strike?booleanRender the inline content with a strikethrough.

RichTextUser()

function RichTextUser(): FluentBuilder<RichTextMentionBuilderInput, JsonObject>;

Creates a structured rich-text mention for one Slack user. Slack resolves the supplied user ID to the appropriate display name when rendering the containing rich-text block.

See: https://docs.slack.dev/reference/block-kit/blocks/rich-text-block#user-element-type.

Chainable setters

Call these setters in any order before .build(). Repeating a singular setter replaces its previous value.

SetterValue typeRequiredDescription
.id(value)stringYesSlack channel, user, or user-group identifier.
.style(value)
RichTextStyle
NoOptional Slack rich-text styling.

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<RichTextMentionBuilderInput, JsonObject>


RichTextUserGroup()

function RichTextUserGroup(): FluentBuilder<RichTextMentionBuilderInput, JsonObject>;

Creates a structured rich-text mention for a Slack user group. Slack resolves the supplied user-group ID when rendering the containing rich-text block.

See: https://docs.slack.dev/reference/block-kit/blocks/rich-text-block#usergroup-element-type.

Chainable setters

Call these setters in any order before .build(). Repeating a singular setter replaces its previous value.

SetterValue typeRequiredDescription
.id(value)stringYesSlack channel, user, or user-group identifier.
.style(value)
RichTextStyle
NoOptional Slack rich-text styling.

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<RichTextMentionBuilderInput, JsonObject>


SlackFile()

function SlackFile(): FluentBuilder<{
id?: string;
url?: string;
}, JsonObject>;

Creates a Slack-hosted image reference for an image block or image element. Supply exactly one Slack file ID or Slack-hosted file URL; the two source forms are mutually exclusive.

See: https://docs.slack.dev/reference/block-kit/composition-objects/slack-file-object.

Chainable setters

Call these setters in any order before .build(). Repeating a singular setter replaces its previous value.

SetterValue typeRequiredDescription
.id(value)stringNoSlack file identifier.
.url(value)stringNoSlack-hosted file URL.

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<{ id?: string; url?: string; }, JsonObject>


SlackIcon()

function SlackIcon(): FluentBuilder<{
name: SlackIconName;
}, SlackObject<"icon">>;

Creates a named icon supplied and rendered by Slack for use in a card block. Choose one of the supported SlackIconName values instead of supplying an image URL.

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.

SetterValue typeRequiredDescription
.name(value)
SlackIconName
Yes

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<{ name: SlackIconName; }, SlackObject<"icon">>


SlackIconName

type SlackIconName =
| "archive"
| "book"
| "bookmark"
| "bot"
| "bug"
| "calendar"
| "call"
| "caret-left"
| "caret-right"
| "check"
| "clipboard"
| "code"
| "comment"
| "compass"
| "copy"
| "cube"
| "download"
| "edit"
| "email"
| "eye-closed"
| "eye-open"
| "file"
| "flag"
| "folder"
| "gear"
| "globe"
| "heart"
| "help"
| "image"
| "info"
| "key"
| "lightbulb"
| "link"
| "map"
| "mobile"
| "new-window"
| "pin"
| "plus"
| "refine"
| "refresh"
| "rocket"
| "save"
| "screen"
| "share"
| "sparkle"
| "star"
| "star-filled"
| "tag"
| "thumbs-down"
| "thumbs-up"
| "trash"
| "upload"
| "user"
| "warning";

Slack-provided icon name accepted by slackIcon.


TextLike

type TextLike = string | TextObject;

Text accepted by factories: a string or an existing Slack text object.


TextObject

type TextObject = SlackObject<"plain_text" | "mrkdwn">;

A Slack plain-text or mrkdwn composition object.


Trigger()

function Trigger(): FluentBuilder<{
customizableInputParameters?: JsonObject[];
url: string;
}, JsonObject>;

Creates the link-trigger definition nested inside a workflow object. Supply the trigger URL generated by Slack and optionally add customizable input parameters.

See: https://docs.slack.dev/reference/block-kit/composition-objects/workflow-object.

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
.url(value)stringYesSlack workflow trigger URL.
.customizableInputParameters(...values)
JsonObject[]
NoOptional parameters created with InputParameter().

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<{ customizableInputParameters?: JsonObject[]; url: string; }, JsonObject>


Workflow()

function Workflow(): FluentBuilder<{
trigger: JsonObject;
}, JsonObject>;

Creates a workflow composition object for a workflow button. It wraps a trigger built with Trigger, including any customizable values the application wants to pass when the user launches the workflow.

See: https://docs.slack.dev/reference/block-kit/composition-objects/workflow-object.

Chainable setters

Call these setters in any order before .build(). Repeating a singular setter replaces its previous value.

SetterValue typeRequiredDescription
.trigger(value)
JsonObject
YesTrigger created with Trigger().

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<{ trigger: JsonObject; }, JsonObject>