Skip to main content

Blocks

This page documents the public Go API for blocks. Every constructor and method shown here is part of the fluent github.com/nicklambourne/slackblocks/go/v2 package.

Every block builder implements slack.Block: pass it directly to slack.MsgOptionBlocks while keeping the channel and other message options in slack-go. Validation runs when slack-go marshals the block, before it sends the request.

NewActionsBlock

NewActionsBlock creates a row of interactive elements.

func NewActionsBlock() *ActionsBlockBuilder

ActionsBlockBuilder

ActionsBlockBuilder is the concrete fluent builder returned by NewActionsBlock. Use NewActionsBlock rather than constructing this type directly.

type ActionsBlockBuilder struct { /* contains filtered or unexported fields */ }

Its fluent methods return the same concrete builder, so invalid fields are rejected at compile time.

It also implements slack.Block, including BlockType() and ID(), and can be passed directly to slack.MsgOptionBlocks.

ActionsBlockBuilder.Elements

Elements appends Slack elements.

func (b *ActionsBlockBuilder) Elements(values ...any) *ActionsBlockBuilder

ActionsBlockBuilder.BlockID

BlockID assigns an application-defined block identifier.

func (b *ActionsBlockBuilder) BlockID(value string) *ActionsBlockBuilder

Every ActionsBlockBuilder also provides Build() (Object, error), MustBuild() Object, and JSON marshaling. Set(field, value) is available as an advanced raw wire-format escape hatch; it deliberately ends the typed fluent chain.

NewAlertBlock

NewAlertBlock creates a severity-labelled notice for a modal.

func NewAlertBlock() *AlertBlockBuilder

AlertBlockBuilder

AlertBlockBuilder is the concrete fluent builder returned by NewAlertBlock. Use NewAlertBlock rather than constructing this type directly.

type AlertBlockBuilder struct { /* contains filtered or unexported fields */ }

Its fluent methods return the same concrete builder, so invalid fields are rejected at compile time.

It also implements slack.Block, including BlockType() and ID(), and can be passed directly to slack.MsgOptionBlocks.

AlertBlockBuilder.Text

Text sets a text-bearing field. Constructors coerce strings to the Slack text-object form required by that field.

func (b *AlertBlockBuilder) Text(value any) *AlertBlockBuilder

AlertBlockBuilder.Level

Level sets alert severity.

func (b *AlertBlockBuilder) Level(value string) *AlertBlockBuilder

AlertBlockBuilder.BlockID

BlockID assigns an application-defined block identifier.

func (b *AlertBlockBuilder) BlockID(value string) *AlertBlockBuilder

Every AlertBlockBuilder also provides Build() (Object, error), MustBuild() Object, and JSON marshaling. Set(field, value) is available as an advanced raw wire-format escape hatch; it deliberately ends the typed fluent chain.

NewCardBlock

NewCardBlock creates a compact card with text, imagery, and actions.

func NewCardBlock() *CardBlockBuilder

CardBlockBuilder

CardBlockBuilder is the concrete fluent builder returned by NewCardBlock. Use NewCardBlock rather than constructing this type directly.

type CardBlockBuilder struct { /* contains filtered or unexported fields */ }

Its fluent methods return the same concrete builder, so invalid fields are rejected at compile time.

It also implements slack.Block, including BlockType() and ID(), and can be passed directly to slack.MsgOptionBlocks.

CardBlockBuilder.HeroImage

HeroImage sets the large image on a card.

func (b *CardBlockBuilder) HeroImage(value any) *CardBlockBuilder

CardBlockBuilder.Icon

Icon sets an icon or icon element.

func (b *CardBlockBuilder) Icon(value any) *CardBlockBuilder

CardBlockBuilder.Title

Title sets a title field.

func (b *CardBlockBuilder) Title(value any) *CardBlockBuilder

CardBlockBuilder.Subtitle

Subtitle sets secondary heading copy.

func (b *CardBlockBuilder) Subtitle(value any) *CardBlockBuilder

CardBlockBuilder.Body

Body sets main card copy.

func (b *CardBlockBuilder) Body(value any) *CardBlockBuilder

CardBlockBuilder.Actions

Actions appends actions to a card.

func (b *CardBlockBuilder) Actions(values ...any) *CardBlockBuilder

CardBlockBuilder.SlackIcon

SlackIcon sets a named Slack icon.

func (b *CardBlockBuilder) SlackIcon(value any) *CardBlockBuilder

CardBlockBuilder.Subtext

Subtext sets supporting card copy.

func (b *CardBlockBuilder) Subtext(value any) *CardBlockBuilder

CardBlockBuilder.BlockID

BlockID assigns an application-defined block identifier.

func (b *CardBlockBuilder) BlockID(value string) *CardBlockBuilder

Every CardBlockBuilder also provides Build() (Object, error), MustBuild() Object, and JSON marshaling. Set(field, value) is available as an advanced raw wire-format escape hatch; it deliberately ends the typed fluent chain.

NewCarouselBlock

NewCarouselBlock creates a horizontally scrolling collection of cards.

func NewCarouselBlock() *CarouselBlockBuilder

CarouselBlockBuilder

CarouselBlockBuilder is the concrete fluent builder returned by NewCarouselBlock. Use NewCarouselBlock rather than constructing this type directly.

type CarouselBlockBuilder struct { /* contains filtered or unexported fields */ }

Its fluent methods return the same concrete builder, so invalid fields are rejected at compile time.

It also implements slack.Block, including BlockType() and ID(), and can be passed directly to slack.MsgOptionBlocks.

CarouselBlockBuilder.Elements

Elements appends Slack elements.

func (b *CarouselBlockBuilder) Elements(values ...any) *CarouselBlockBuilder

CarouselBlockBuilder.BlockID

BlockID assigns an application-defined block identifier.

func (b *CarouselBlockBuilder) BlockID(value string) *CarouselBlockBuilder

Every CarouselBlockBuilder also provides Build() (Object, error), MustBuild() Object, and JSON marshaling. Set(field, value) is available as an advanced raw wire-format escape hatch; it deliberately ends the typed fluent chain.

NewContainerBlock

NewContainerBlock creates a titled group of child blocks.

func NewContainerBlock() *ContainerBlockBuilder

ContainerBlockBuilder

ContainerBlockBuilder is the concrete fluent builder returned by NewContainerBlock. Use NewContainerBlock rather than constructing this type directly.

type ContainerBlockBuilder struct { /* contains filtered or unexported fields */ }

Its fluent methods return the same concrete builder, so invalid fields are rejected at compile time.

It also implements slack.Block, including BlockType() and ID(), and can be passed directly to slack.MsgOptionBlocks.

ContainerBlockBuilder.ChildBlocks

ChildBlocks appends blocks to a container.

func (b *ContainerBlockBuilder) ChildBlocks(values ...any) *ContainerBlockBuilder

ContainerBlockBuilder.Title

Title sets a title field.

func (b *ContainerBlockBuilder) Title(value any) *ContainerBlockBuilder

ContainerBlockBuilder.RichTextTitle

RichTextTitle sets a container rich-text title.

func (b *ContainerBlockBuilder) RichTextTitle(value any) *ContainerBlockBuilder

ContainerBlockBuilder.Subtitle

Subtitle sets secondary heading copy.

func (b *ContainerBlockBuilder) Subtitle(value any) *ContainerBlockBuilder

ContainerBlockBuilder.Width

Width sets container width.

func (b *ContainerBlockBuilder) Width(value string) *ContainerBlockBuilder

ContainerBlockBuilder.Icon

Icon sets an icon or icon element.

func (b *ContainerBlockBuilder) Icon(value any) *ContainerBlockBuilder

ContainerBlockBuilder.IsCollapsible

IsCollapsible controls container expansion.

func (b *ContainerBlockBuilder) IsCollapsible(value bool) *ContainerBlockBuilder

ContainerBlockBuilder.DefaultCollapsed

DefaultCollapsed controls the initial state of a collapsible container.

func (b *ContainerBlockBuilder) DefaultCollapsed(value bool) *ContainerBlockBuilder

ContainerBlockBuilder.HasHeaderDivider

HasHeaderDivider controls a container header divider.

func (b *ContainerBlockBuilder) HasHeaderDivider(value bool) *ContainerBlockBuilder

ContainerBlockBuilder.BlockID

BlockID assigns an application-defined block identifier.

func (b *ContainerBlockBuilder) BlockID(value string) *ContainerBlockBuilder

Every ContainerBlockBuilder also provides Build() (Object, error), MustBuild() Object, and JSON marshaling. Set(field, value) is available as an advanced raw wire-format escape hatch; it deliberately ends the typed fluent chain.

NewContextActionsBlock

NewContextActionsBlock creates contextual feedback or icon controls.

func NewContextActionsBlock() *ContextActionsBlockBuilder

ContextActionsBlockBuilder

ContextActionsBlockBuilder is the concrete fluent builder returned by NewContextActionsBlock. Use NewContextActionsBlock rather than constructing this type directly.

type ContextActionsBlockBuilder struct { /* contains filtered or unexported fields */ }

Its fluent methods return the same concrete builder, so invalid fields are rejected at compile time.

It also implements slack.Block, including BlockType() and ID(), and can be passed directly to slack.MsgOptionBlocks.

ContextActionsBlockBuilder.Elements

Elements appends Slack elements.

func (b *ContextActionsBlockBuilder) Elements(values ...any) *ContextActionsBlockBuilder

ContextActionsBlockBuilder.BlockID

BlockID assigns an application-defined block identifier.

func (b *ContextActionsBlockBuilder) BlockID(value string) *ContextActionsBlockBuilder

Every ContextActionsBlockBuilder also provides Build() (Object, error), MustBuild() Object, and JSON marshaling. Set(field, value) is available as an advanced raw wire-format escape hatch; it deliberately ends the typed fluent chain.

NewContextBlock

NewContextBlock creates compact contextual text and images.

func NewContextBlock() *ContextBlockBuilder

ContextBlockBuilder

ContextBlockBuilder is the concrete fluent builder returned by NewContextBlock. Use NewContextBlock rather than constructing this type directly.

type ContextBlockBuilder struct { /* contains filtered or unexported fields */ }

Its fluent methods return the same concrete builder, so invalid fields are rejected at compile time.

It also implements slack.Block, including BlockType() and ID(), and can be passed directly to slack.MsgOptionBlocks.

ContextBlockBuilder.Elements

Elements appends Slack elements.

func (b *ContextBlockBuilder) Elements(values ...any) *ContextBlockBuilder

ContextBlockBuilder.BlockID

BlockID assigns an application-defined block identifier.

func (b *ContextBlockBuilder) BlockID(value string) *ContextBlockBuilder

Every ContextBlockBuilder also provides Build() (Object, error), MustBuild() Object, and JSON marshaling. Set(field, value) is available as an advanced raw wire-format escape hatch; it deliberately ends the typed fluent chain.

NewDataTableBlock

NewDataTableBlock creates a sortable, paginated data table.

func NewDataTableBlock() *DataTableBlockBuilder

DataTableBlockBuilder

DataTableBlockBuilder is the concrete fluent builder returned by NewDataTableBlock. Use NewDataTableBlock rather than constructing this type directly.

type DataTableBlockBuilder struct { /* contains filtered or unexported fields */ }

Its fluent methods return the same concrete builder, so invalid fields are rejected at compile time.

It also implements slack.Block, including BlockType() and ID(), and can be passed directly to slack.MsgOptionBlocks.

DataTableBlockBuilder.Rows

Rows appends table rows. Each argument should be a slice of cells.

func (b *DataTableBlockBuilder) Rows(values ...any) *DataTableBlockBuilder

DataTableBlockBuilder.Caption

Caption sets an accessible data-table caption.

func (b *DataTableBlockBuilder) Caption(value string) *DataTableBlockBuilder

DataTableBlockBuilder.PageSize

PageSize sets data-table rows per page.

func (b *DataTableBlockBuilder) PageSize(value int) *DataTableBlockBuilder

DataTableBlockBuilder.RowHeaderColumnIndex

RowHeaderColumnIndex sets the zero-based data-table row-header column.

func (b *DataTableBlockBuilder) RowHeaderColumnIndex(value int) *DataTableBlockBuilder

DataTableBlockBuilder.BlockID

BlockID assigns an application-defined block identifier.

func (b *DataTableBlockBuilder) BlockID(value string) *DataTableBlockBuilder

Every DataTableBlockBuilder also provides Build() (Object, error), MustBuild() Object, and JSON marshaling. Set(field, value) is available as an advanced raw wire-format escape hatch; it deliberately ends the typed fluent chain.

NewDataVisualizationBlock

NewDataVisualizationBlock creates a Slack-rendered chart block.

func NewDataVisualizationBlock() *DataVisualizationBlockBuilder

DataVisualizationBlockBuilder

DataVisualizationBlockBuilder is the concrete fluent builder returned by NewDataVisualizationBlock. Use NewDataVisualizationBlock rather than constructing this type directly.

type DataVisualizationBlockBuilder struct { /* contains filtered or unexported fields */ }

Its fluent methods return the same concrete builder, so invalid fields are rejected at compile time.

It also implements slack.Block, including BlockType() and ID(), and can be passed directly to slack.MsgOptionBlocks.

DataVisualizationBlockBuilder.Title

Title sets a title field.

func (b *DataVisualizationBlockBuilder) Title(value any) *DataVisualizationBlockBuilder

DataVisualizationBlockBuilder.Chart

Chart sets a chart object on a data-visualization block.

func (b *DataVisualizationBlockBuilder) Chart(value any) *DataVisualizationBlockBuilder

DataVisualizationBlockBuilder.BlockID

BlockID assigns an application-defined block identifier.

func (b *DataVisualizationBlockBuilder) BlockID(value string) *DataVisualizationBlockBuilder

Every DataVisualizationBlockBuilder also provides Build() (Object, error), MustBuild() Object, and JSON marshaling. Set(field, value) is available as an advanced raw wire-format escape hatch; it deliberately ends the typed fluent chain.

NewDividerBlock

NewDividerBlock creates a visual divider block.

func NewDividerBlock() *DividerBlockBuilder

DividerBlockBuilder

DividerBlockBuilder is the concrete fluent builder returned by NewDividerBlock. Use NewDividerBlock rather than constructing this type directly.

type DividerBlockBuilder struct { /* contains filtered or unexported fields */ }

Its fluent methods return the same concrete builder, so invalid fields are rejected at compile time.

It also implements slack.Block, including BlockType() and ID(), and can be passed directly to slack.MsgOptionBlocks.

DividerBlockBuilder.BlockID

BlockID assigns an application-defined block identifier.

func (b *DividerBlockBuilder) BlockID(value string) *DividerBlockBuilder

Every DividerBlockBuilder also provides Build() (Object, error), MustBuild() Object, and JSON marshaling. Set(field, value) is available as an advanced raw wire-format escape hatch; it deliberately ends the typed fluent chain.

NewFileBlock

NewFileBlock creates a block for a Slack remote file.

func NewFileBlock() *FileBlockBuilder

FileBlockBuilder

FileBlockBuilder is the concrete fluent builder returned by NewFileBlock. Use NewFileBlock rather than constructing this type directly.

type FileBlockBuilder struct { /* contains filtered or unexported fields */ }

Its fluent methods return the same concrete builder, so invalid fields are rejected at compile time.

It also implements slack.Block, including BlockType() and ID(), and can be passed directly to slack.MsgOptionBlocks.

FileBlockBuilder.ExternalID

ExternalID sets an application-defined external identifier.

func (b *FileBlockBuilder) ExternalID(value string) *FileBlockBuilder

FileBlockBuilder.Source

Source sets a file source.

func (b *FileBlockBuilder) Source(value string) *FileBlockBuilder

FileBlockBuilder.BlockID

BlockID assigns an application-defined block identifier.

func (b *FileBlockBuilder) BlockID(value string) *FileBlockBuilder

Every FileBlockBuilder also provides Build() (Object, error), MustBuild() Object, and JSON marshaling. Set(field, value) is available as an advanced raw wire-format escape hatch; it deliberately ends the typed fluent chain.

NewHeaderBlock

NewHeaderBlock creates a prominent plain-text heading.

func NewHeaderBlock() *HeaderBlockBuilder

HeaderBlockBuilder

HeaderBlockBuilder is the concrete fluent builder returned by NewHeaderBlock. Use NewHeaderBlock rather than constructing this type directly.

type HeaderBlockBuilder struct { /* contains filtered or unexported fields */ }

Its fluent methods return the same concrete builder, so invalid fields are rejected at compile time.

It also implements slack.Block, including BlockType() and ID(), and can be passed directly to slack.MsgOptionBlocks.

HeaderBlockBuilder.Text

Text sets a text-bearing field. Constructors coerce strings to the Slack text-object form required by that field.

func (b *HeaderBlockBuilder) Text(value any) *HeaderBlockBuilder

HeaderBlockBuilder.BlockID

BlockID assigns an application-defined block identifier.

func (b *HeaderBlockBuilder) BlockID(value string) *HeaderBlockBuilder

Every HeaderBlockBuilder also provides Build() (Object, error), MustBuild() Object, and JSON marshaling. Set(field, value) is available as an advanced raw wire-format escape hatch; it deliberately ends the typed fluent chain.

NewImageBlock

NewImageBlock creates an image block with optional title text.

func NewImageBlock() *ImageBlockBuilder

ImageBlockBuilder

ImageBlockBuilder is the concrete fluent builder returned by NewImageBlock. Use NewImageBlock rather than constructing this type directly.

type ImageBlockBuilder struct { /* contains filtered or unexported fields */ }

Its fluent methods return the same concrete builder, so invalid fields are rejected at compile time.

It also implements slack.Block, including BlockType() and ID(), and can be passed directly to slack.MsgOptionBlocks.

ImageBlockBuilder.ImageURL

ImageURL sets a public image URL.

func (b *ImageBlockBuilder) ImageURL(value string) *ImageBlockBuilder

ImageBlockBuilder.AltText

AltText sets an accessible image or video description.

func (b *ImageBlockBuilder) AltText(value string) *ImageBlockBuilder

ImageBlockBuilder.Title

Title sets a title field.

func (b *ImageBlockBuilder) Title(value any) *ImageBlockBuilder

ImageBlockBuilder.BlockID

BlockID assigns an application-defined block identifier.

func (b *ImageBlockBuilder) BlockID(value string) *ImageBlockBuilder

Every ImageBlockBuilder also provides Build() (Object, error), MustBuild() Object, and JSON marshaling. Set(field, value) is available as an advanced raw wire-format escape hatch; it deliberately ends the typed fluent chain.

NewInputBlock

NewInputBlock creates a labelled form control.

func NewInputBlock() *InputBlockBuilder

InputBlockBuilder

InputBlockBuilder is the concrete fluent builder returned by NewInputBlock. Use NewInputBlock rather than constructing this type directly.

type InputBlockBuilder struct { /* contains filtered or unexported fields */ }

Its fluent methods return the same concrete builder, so invalid fields are rejected at compile time.

It also implements slack.Block, including BlockType() and ID(), and can be passed directly to slack.MsgOptionBlocks.

InputBlockBuilder.Label

Label sets a label field.

func (b *InputBlockBuilder) Label(value any) *InputBlockBuilder

InputBlockBuilder.Element

Element sets the interactive element in an input block.

func (b *InputBlockBuilder) Element(value any) *InputBlockBuilder

InputBlockBuilder.DispatchAction

DispatchAction controls immediate input dispatch.

func (b *InputBlockBuilder) DispatchAction(value bool) *InputBlockBuilder

InputBlockBuilder.BlockID

BlockID assigns an application-defined block identifier.

func (b *InputBlockBuilder) BlockID(value string) *InputBlockBuilder

InputBlockBuilder.Hint

Hint sets supporting input help text.

func (b *InputBlockBuilder) Hint(value any) *InputBlockBuilder

InputBlockBuilder.Optional

Optional makes an input block optional.

func (b *InputBlockBuilder) Optional(value bool) *InputBlockBuilder

Every InputBlockBuilder also provides Build() (Object, error), MustBuild() Object, and JSON marshaling. Set(field, value) is available as an advanced raw wire-format escape hatch; it deliberately ends the typed fluent chain.

NewMarkdownBlock

NewMarkdownBlock creates a block rendered from GitHub-flavoured Markdown.

func NewMarkdownBlock() *MarkdownBlockBuilder

MarkdownBlockBuilder

MarkdownBlockBuilder is the concrete fluent builder returned by NewMarkdownBlock. Use NewMarkdownBlock rather than constructing this type directly.

type MarkdownBlockBuilder struct { /* contains filtered or unexported fields */ }

Its fluent methods return the same concrete builder, so invalid fields are rejected at compile time.

It also implements slack.Block, including BlockType() and ID(), and can be passed directly to slack.MsgOptionBlocks.

MarkdownBlockBuilder.Text

Text sets a text-bearing field. Constructors coerce strings to the Slack text-object form required by that field.

func (b *MarkdownBlockBuilder) Text(value any) *MarkdownBlockBuilder

MarkdownBlockBuilder.BlockID

BlockID assigns an application-defined block identifier.

func (b *MarkdownBlockBuilder) BlockID(value string) *MarkdownBlockBuilder

Every MarkdownBlockBuilder also provides Build() (Object, error), MustBuild() Object, and JSON marshaling. Set(field, value) is available as an advanced raw wire-format escape hatch; it deliberately ends the typed fluent chain.

NewPlanBlock

NewPlanBlock creates a titled sequence of tasks.

func NewPlanBlock() *PlanBlockBuilder

PlanBlockBuilder

PlanBlockBuilder is the concrete fluent builder returned by NewPlanBlock. Use NewPlanBlock rather than constructing this type directly.

type PlanBlockBuilder struct { /* contains filtered or unexported fields */ }

Its fluent methods return the same concrete builder, so invalid fields are rejected at compile time.

It also implements slack.Block, including BlockType() and ID(), and can be passed directly to slack.MsgOptionBlocks.

PlanBlockBuilder.Title

Title sets a title field.

func (b *PlanBlockBuilder) Title(value any) *PlanBlockBuilder

PlanBlockBuilder.Tasks

Tasks appends task-card blocks.

func (b *PlanBlockBuilder) Tasks(values ...any) *PlanBlockBuilder

PlanBlockBuilder.BlockID

BlockID assigns an application-defined block identifier.

func (b *PlanBlockBuilder) BlockID(value string) *PlanBlockBuilder

Every PlanBlockBuilder also provides Build() (Object, error), MustBuild() Object, and JSON marshaling. Set(field, value) is available as an advanced raw wire-format escape hatch; it deliberately ends the typed fluent chain.

NewRichTextBlock

NewRichTextBlock creates a rich-text layout block.

func NewRichTextBlock() *RichTextBlockBuilder

RichTextBlockBuilder

RichTextBlockBuilder is the concrete fluent builder returned by NewRichTextBlock. Use NewRichTextBlock rather than constructing this type directly.

type RichTextBlockBuilder struct { /* contains filtered or unexported fields */ }

Its fluent methods return the same concrete builder, so invalid fields are rejected at compile time.

It also implements slack.Block, including BlockType() and ID(), and can be passed directly to slack.MsgOptionBlocks.

RichTextBlockBuilder.Elements

Elements appends Slack elements.

func (b *RichTextBlockBuilder) Elements(values ...any) *RichTextBlockBuilder

RichTextBlockBuilder.BlockID

BlockID assigns an application-defined block identifier.

func (b *RichTextBlockBuilder) BlockID(value string) *RichTextBlockBuilder

Every RichTextBlockBuilder also provides Build() (Object, error), MustBuild() Object, and JSON marshaling. Set(field, value) is available as an advanced raw wire-format escape hatch; it deliberately ends the typed fluent chain.

NewSectionBlock

NewSectionBlock creates a section block. String text and fields are coerced to Slack mrkdwn objects.

func NewSectionBlock() *SectionBlockBuilder

SectionBlockBuilder

SectionBlockBuilder is the concrete fluent builder returned by NewSectionBlock. Use NewSectionBlock rather than constructing this type directly.

type SectionBlockBuilder struct { /* contains filtered or unexported fields */ }

Its fluent methods return the same concrete builder, so invalid fields are rejected at compile time.

It also implements slack.Block, including BlockType() and ID(), and can be passed directly to slack.MsgOptionBlocks.

SectionBlockBuilder.Text

Text sets a text-bearing field. Constructors coerce strings to the Slack text-object form required by that field.

func (b *SectionBlockBuilder) Text(value any) *SectionBlockBuilder

SectionBlockBuilder.Fields

Fields appends section fields in display order.

func (b *SectionBlockBuilder) Fields(values ...any) *SectionBlockBuilder

SectionBlockBuilder.Accessory

Accessory sets the optional section accessory element.

func (b *SectionBlockBuilder) Accessory(value any) *SectionBlockBuilder

SectionBlockBuilder.BlockID

BlockID assigns an application-defined block identifier.

func (b *SectionBlockBuilder) BlockID(value string) *SectionBlockBuilder

Every SectionBlockBuilder also provides Build() (Object, error), MustBuild() Object, and JSON marshaling. Set(field, value) is available as an advanced raw wire-format escape hatch; it deliberately ends the typed fluent chain.

NewTableBlock

NewTableBlock creates a table from raw-text or rich-text cells.

func NewTableBlock() *TableBlockBuilder

TableBlockBuilder

TableBlockBuilder is the concrete fluent builder returned by NewTableBlock. Use NewTableBlock rather than constructing this type directly.

type TableBlockBuilder struct { /* contains filtered or unexported fields */ }

Its fluent methods return the same concrete builder, so invalid fields are rejected at compile time.

It also implements slack.Block, including BlockType() and ID(), and can be passed directly to slack.MsgOptionBlocks.

TableBlockBuilder.Rows

Rows appends table rows. Each argument should be a slice of cells.

func (b *TableBlockBuilder) Rows(values ...any) *TableBlockBuilder

TableBlockBuilder.ColumnSettings

ColumnSettings appends table column display settings.

func (b *TableBlockBuilder) ColumnSettings(values ...any) *TableBlockBuilder

TableBlockBuilder.BlockID

BlockID assigns an application-defined block identifier.

func (b *TableBlockBuilder) BlockID(value string) *TableBlockBuilder

Every TableBlockBuilder also provides Build() (Object, error), MustBuild() Object, and JSON marshaling. Set(field, value) is available as an advanced raw wire-format escape hatch; it deliberately ends the typed fluent chain.

NewTaskCardBlock

NewTaskCardBlock creates one task in a plan.

func NewTaskCardBlock() *TaskCardBlockBuilder

TaskCardBlockBuilder

TaskCardBlockBuilder is the concrete fluent builder returned by NewTaskCardBlock. Use NewTaskCardBlock rather than constructing this type directly.

type TaskCardBlockBuilder struct { /* contains filtered or unexported fields */ }

Its fluent methods return the same concrete builder, so invalid fields are rejected at compile time.

It also implements slack.Block, including BlockType() and ID(), and can be passed directly to slack.MsgOptionBlocks.

TaskCardBlockBuilder.TaskID

TaskID sets a stable task identifier.

func (b *TaskCardBlockBuilder) TaskID(value string) *TaskCardBlockBuilder

TaskCardBlockBuilder.Title

Title sets a title field.

func (b *TaskCardBlockBuilder) Title(value any) *TaskCardBlockBuilder

TaskCardBlockBuilder.Details

Details sets rich task details.

func (b *TaskCardBlockBuilder) Details(value any) *TaskCardBlockBuilder

TaskCardBlockBuilder.Output

Output sets rich task output.

func (b *TaskCardBlockBuilder) Output(value any) *TaskCardBlockBuilder

TaskCardBlockBuilder.Sources

Sources appends task source links.

func (b *TaskCardBlockBuilder) Sources(values ...any) *TaskCardBlockBuilder

TaskCardBlockBuilder.Status

Status sets task lifecycle state.

func (b *TaskCardBlockBuilder) Status(value string) *TaskCardBlockBuilder

TaskCardBlockBuilder.BlockID

BlockID assigns an application-defined block identifier.

func (b *TaskCardBlockBuilder) BlockID(value string) *TaskCardBlockBuilder

Every TaskCardBlockBuilder also provides Build() (Object, error), MustBuild() Object, and JSON marshaling. Set(field, value) is available as an advanced raw wire-format escape hatch; it deliberately ends the typed fluent chain.

NewVideoBlock

NewVideoBlock creates an embedded video block.

func NewVideoBlock() *VideoBlockBuilder

VideoBlockBuilder

VideoBlockBuilder is the concrete fluent builder returned by NewVideoBlock. Use NewVideoBlock rather than constructing this type directly.

type VideoBlockBuilder struct { /* contains filtered or unexported fields */ }

Its fluent methods return the same concrete builder, so invalid fields are rejected at compile time.

It also implements slack.Block, including BlockType() and ID(), and can be passed directly to slack.MsgOptionBlocks.

VideoBlockBuilder.AltText

AltText sets an accessible image or video description.

func (b *VideoBlockBuilder) AltText(value string) *VideoBlockBuilder

VideoBlockBuilder.ThumbnailURL

ThumbnailURL sets a video preview image.

func (b *VideoBlockBuilder) ThumbnailURL(value string) *VideoBlockBuilder

VideoBlockBuilder.Title

Title sets a title field.

func (b *VideoBlockBuilder) Title(value any) *VideoBlockBuilder

VideoBlockBuilder.VideoURL

VideoURL sets the hosted video URL.

func (b *VideoBlockBuilder) VideoURL(value string) *VideoBlockBuilder

VideoBlockBuilder.BlockID

BlockID assigns an application-defined block identifier.

func (b *VideoBlockBuilder) BlockID(value string) *VideoBlockBuilder

VideoBlockBuilder.AuthorName

AuthorName sets video author attribution.

func (b *VideoBlockBuilder) AuthorName(value string) *VideoBlockBuilder

VideoBlockBuilder.Description

Description sets supporting descriptive text.

func (b *VideoBlockBuilder) Description(value any) *VideoBlockBuilder

VideoBlockBuilder.ProviderIconURL

ProviderIconURL sets a video provider icon.

func (b *VideoBlockBuilder) ProviderIconURL(value string) *VideoBlockBuilder

VideoBlockBuilder.ProviderName

ProviderName sets video provider attribution.

func (b *VideoBlockBuilder) ProviderName(value string) *VideoBlockBuilder

VideoBlockBuilder.TitleURL

TitleURL sets a video or card title URL.

func (b *VideoBlockBuilder) TitleURL(value string) *VideoBlockBuilder

Every VideoBlockBuilder also provides Build() (Object, error), MustBuild() Object, and JSON marshaling. Set(field, value) is available as an advanced raw wire-format escape hatch; it deliberately ends the typed fluent chain.