blocks

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 23, 2026 License: MIT Imports: 7 Imported by: 0

README

blocks

Type-safe Go library for building Slack Block Kit UIs.

Back to main documentation

Architecture

Hierarchy
Surface (Message, Modal, HomeTab)
    |
    +-- Block (Section, Actions, Header, etc.)
            |
            +-- Element (Button, Select, DatePicker, etc.)
                    |
                    +-- Composition Object (PlainText, Markdown, Option, etc.)
Type Safety

The library uses sealed marker interfaces to ensure elements are only used where valid:

// These interfaces restrict where elements can be placed
type Block interface { ... }              // Top-level blocks
type SectionAccessory interface { ... }   // Valid in section blocks
type ActionsElement interface { ... }     // Valid in actions blocks
type ContextElement interface { ... }     // Valid in context blocks
type InputElement interface { ... }       // Valid in input blocks

For example, a Button implements both SectionAccessory and ActionsElement, so it can be used in both contexts. But an EmailInput only implements InputElement, so it can only be used in input blocks.

Patterns

Constructor Pattern

All types use a New<Type>() constructor that returns (<Type>, error):

button, err := blocks.NewButton("Click me")
if err != nil {
    // handle error
}

For convenience, Must<Type>() variants panic on error (useful in tests or static configurations):

button := blocks.MustButton("Click me")
Functional Options

All types support optional configuration via functional options:

button, err := blocks.NewButton("Delete",
    blocks.WithActionID("delete_btn"),
    blocks.WithButtonStyle(blocks.ButtonStyleDanger),
    blocks.WithButtonConfirm(confirmDialog),
)

Options follow the naming convention With<Type><Field>():

// Button options
blocks.WithActionID("...")
blocks.WithValue("...")
blocks.WithButtonStyle(blocks.ButtonStylePrimary)
blocks.WithButtonConfirm(dialog)

// Section options
blocks.WithSectionBlockID("...")
blocks.WithSectionAccessory(button)
blocks.WithSectionFields(field1, field2)
Builder Pattern

The Builder provides a fluent API for composing multiple blocks:

builder := blocks.NewBuilder().
    AddHeader("Report").
    AddSection(blocks.MustMarkdown("*Summary*")).
    AddDivider().
    AddContext([]blocks.ContextElement{
        blocks.MustPlainText("Last updated: today"),
    })

// Convert to different surfaces
message, _ := builder.ToMessage("Report")
modal, _ := builder.ToModal("Report Modal")
homeTab, _ := builder.ToHomeTab()

// Or get raw blocks
blks, _ := builder.Build()

// Get JSON directly
jsonData, _ := builder.PrettyJSON()

Surfaces

Surfaces are the top-level containers that hold blocks.

Message
// With builder
message := blocks.NewBuilder().
    AddHeader("Notification").
    AddSection(blocks.MustMarkdown("You have a new message")).
    MustToMessage("New notification")

// Direct construction
message, err := blocks.NewMessage("Fallback text", myBlocks,
    blocks.WithMessageThreadTS("1234567890.123456"),
    blocks.WithMessageMrkdwn(),
)
Modal
modal, err := blocks.NewModal("Settings", myBlocks,
    blocks.WithModalSubmit("Save"),
    blocks.WithModalClose("Cancel"),
    blocks.WithModalCallbackID("settings_modal"),
    blocks.WithModalPrivateMetadata(`{"user_id": "U123"}`),
    blocks.WithModalClearOnClose(),
    blocks.WithModalNotifyOnClose(),
)
Home Tab
homeTab, err := blocks.NewHomeTab(myBlocks,
    blocks.WithHomeTabCallbackID("home_view"),
    blocks.WithHomeTabPrivateMetadata("..."),
)

Blocks

Section

The most flexible block, supports text, fields, and accessories.

// With text
section, _ := blocks.NewSection(blocks.MustMarkdown("*Bold* text"))

// With accessory
section, _ := blocks.NewSection(
    blocks.MustMarkdown("Choose an option:"),
    blocks.WithSectionAccessory(selectMenu),
)

// With fields (2-column layout)
section, _ := blocks.NewSectionWithFields([]blocks.TextObject{
    blocks.MustMarkdown("*Name:*\nJohn"),
    blocks.MustMarkdown("*Role:*\nAdmin"),
})
Actions

Container for interactive elements (max 25 elements).

actions, _ := blocks.NewActions([]blocks.ActionsElement{
    blocks.MustButton("Approve", blocks.WithButtonStyle(blocks.ButtonStylePrimary)),
    blocks.MustButton("Reject", blocks.WithButtonStyle(blocks.ButtonStyleDanger)),
    datePicker,
    selectMenu,
})
Context

Displays secondary information (max 10 elements).

context, _ := blocks.NewContext([]blocks.ContextElement{
    imageElement,
    blocks.MustMarkdown("Posted by <@U123>"),
    blocks.MustPlainText("2 hours ago"),
})
Input

Collects user input in modals and messages.

input, _ := blocks.NewInput("Email", blocks.NewEmailInput(),
    blocks.WithInputBlockID("email_input"),
    blocks.WithInputHint("Enter your work email"),
    blocks.WithInputOptional(),
)
Header

Large text for section titles (max 150 characters).

header, _ := blocks.NewHeader("Configuration")
Divider

Visual separator between blocks.

divider := blocks.NewDivider()
Image

Displays an image.

image, _ := blocks.NewImageBlock(
    "https://example.com/image.png",
    "Description of image",
    blocks.WithImageBlockTitle("My Image"),
)
Video

Embedded video player.

video, _ := blocks.NewVideo(
    "Video description",
    "My Video",
    "https://example.com/thumb.png",
    "https://example.com/video.mp4",
    blocks.WithVideoAuthorName("John Doe"),
    blocks.WithVideoProviderName("YouTube"),
)
File

Displays remote file information (read-only, appears in retrieved messages).

file, _ := blocks.NewFile("external_file_id")
Rich Text

Structured formatted text with sections, lists, and quotes.

section := blocks.NewRichTextSection([]blocks.RichTextSectionElement{
    blocks.NewRichTextText("Hello ", nil),
    blocks.NewRichTextText("world", blocks.NewRichTextStyle(true, false, false, false)), // bold
    blocks.NewRichTextEmoji("wave"),
})

list := blocks.NewRichTextList("bullet", []blocks.RichTextSection{
    blocks.NewRichTextSection([]blocks.RichTextSectionElement{
        blocks.NewRichTextText("First item", nil),
    }),
    blocks.NewRichTextSection([]blocks.RichTextSectionElement{
        blocks.NewRichTextText("Second item", nil),
    }),
})

richText, _ := blocks.NewRichText([]blocks.RichTextElement{section, list})
Table

Structured tabular data (messages only).

col1 := blocks.NewTableColumn("name", "Name")
col2 := blocks.NewTableColumn("value", "Value")

row := blocks.NewTableRow([]blocks.TableCell{
    blocks.NewTableCell("name", blocks.NewTableCellText("Item")),
    blocks.NewTableCell("value", blocks.NewTableCellText("$100")),
})

table, _ := blocks.NewTable([]blocks.TableColumn{col1, col2}, []blocks.TableRow{row})
Plan

Collection of tasks (messages only).

item1 := blocks.MustPlanItem("Setup environment", blocks.PlanItemStatusComplete)
item2 := blocks.MustPlanItem("Write tests", blocks.PlanItemStatusInProgress)
item3 := blocks.MustPlanItem("Deploy", blocks.PlanItemStatusPending)

section := blocks.MustPlanSection("Phase 1", []blocks.PlanItem{item1, item2, item3})
plan, _ := blocks.NewPlan("Project Plan", []blocks.PlanSection{section})
Task Card

Single task display (messages only).

source := blocks.MustURLSource("https://github.com/...", blocks.WithURLSourceTitle("GitHub"))

taskCard, _ := blocks.NewTaskCard("task_1", "Fix login bug", blocks.TaskCardStatusInProgress,
    blocks.WithTaskCardDescription("Users can't log in with SSO"),
    blocks.WithTaskCardSources([]blocks.URLSource{source}),
)
Context Actions

AI/assistant feedback buttons (messages only).

contextActions, _ := blocks.NewContextActions([]blocks.ContextActionsElement{
    blocks.NewFeedbackButtons(blocks.WithFeedbackButtonsActionID("feedback")),
    blocks.NewIconButton(blocks.NewIcon("copy"), blocks.WithIconButtonActionID("copy")),
})
Markdown Block

Raw markdown content (messages only).

md, _ := blocks.NewMarkdownBlock("# Heading\n\nParagraph with **bold** text.")

Elements

Button
button, _ := blocks.NewButton("Click me",
    blocks.WithActionID("btn_click"),
    blocks.WithValue("clicked"),
    blocks.WithButtonStyle(blocks.ButtonStylePrimary), // or ButtonStyleDanger
    blocks.WithURL("https://example.com"),
    blocks.WithButtonConfirm(confirmDialog),
    blocks.WithAccessibilityLabel("Click this button"),
)
Select Menus
// Static select
option1 := blocks.MustOption("Option 1", "opt1")
option2 := blocks.MustOption("Option 2", "opt2")
staticSelect, _ := blocks.NewStaticSelect([]blocks.Option{option1, option2},
    blocks.WithStaticSelectActionID("select_action"),
    blocks.WithStaticSelectPlaceholder("Choose..."),
    blocks.WithStaticSelectInitial(option1),
)

// Users select
usersSelect := blocks.NewUsersSelect(
    blocks.WithUsersSelectActionID("user_select"),
    blocks.WithUsersSelectInitialUser("U123"),
)

// Conversations select
convoSelect := blocks.NewConversationsSelect(
    blocks.WithConversationsSelectActionID("convo_select"),
    blocks.WithConversationsSelectFilter(filter),
)

// Channels select
channelSelect := blocks.NewChannelsSelect(
    blocks.WithChannelsSelectActionID("channel_select"),
)

// External select (load options from your server)
externalSelect := blocks.NewExternalSelect(
    blocks.WithExternalSelectActionID("external_select"),
    blocks.WithExternalSelectMinQueryLength(3),
)
Multi-Select Menus

All select types have multi-select variants:

multiSelect, _ := blocks.NewMultiStaticSelect(options,
    blocks.WithMultiStaticSelectActionID("multi_select"),
    blocks.WithMultiStaticSelectMaxItems(5),
)
Date & Time Pickers
datePicker := blocks.NewDatePicker(
    blocks.WithDatePickerActionID("date_pick"),
    blocks.WithDatePickerInitialDate("2024-01-15"),
    blocks.WithDatePickerPlaceholder("Select date"),
)

timePicker := blocks.NewTimePicker(
    blocks.WithTimePickerActionID("time_pick"),
    blocks.WithTimePickerInitialTime("14:30"),
)

datetimePicker := blocks.NewDatetimePicker(
    blocks.WithDatetimePickerActionID("datetime_pick"),
    blocks.WithDatetimePickerInitialDateTime(1702656000), // Unix timestamp
)
Checkboxes & Radio Buttons
checkboxes, _ := blocks.NewCheckboxes(options,
    blocks.WithCheckboxesActionID("checkboxes"),
    blocks.WithCheckboxesInitialOptions(option1, option2),
)

radioButtons, _ := blocks.NewRadioButtons(options,
    blocks.WithRadioButtonsActionID("radio"),
    blocks.WithRadioButtonsInitialOption(option1),
)
Input Elements
// Plain text input
textInput := blocks.NewPlainTextInput(
    blocks.WithPlainTextInputActionID("text_input"),
    blocks.WithMultiline(),
    blocks.WithMinLength(10),
    blocks.WithMaxLength(500),
    blocks.WithPlainTextInputPlaceholder("Enter text..."),
)

// Email input
emailInput := blocks.NewEmailInput(
    blocks.WithEmailInputActionID("email"),
    blocks.WithEmailInputPlaceholder("you@example.com"),
)

// Number input
numberInput := blocks.NewNumberInput(true, // allow decimals
    blocks.WithNumberInputActionID("number"),
    blocks.WithNumberInputMinValue("0"),
    blocks.WithNumberInputMaxValue("100"),
)

// URL input
urlInput := blocks.NewURLInput(
    blocks.WithURLInputActionID("url"),
    blocks.WithURLInputPlaceholder("https://..."),
)

// File input
fileInput := blocks.NewFileInput(
    blocks.WithFileInputActionID("file"),
    blocks.WithFileInputFiletypes([]string{"pdf", "doc"}),
    blocks.WithFileInputMaxFiles(5),
)

// Rich text input
richTextInput := blocks.NewRichTextInput(
    blocks.WithRichTextInputActionID("rich_text"),
    blocks.WithRichTextInputPlaceholder("Write something..."),
)
Overflow Menu
overflow, _ := blocks.NewOverflow(options,
    blocks.WithOverflowActionID("overflow_menu"),
    blocks.WithOverflowConfirm(confirmDialog),
)
Workflow Button
trigger := blocks.MustTrigger("https://slack.com/shortcuts/...",
    blocks.WithInputParameters(
        blocks.MustInputParameter("user_id", "{{user.id}}"),
    ),
)

workflowBtn, _ := blocks.NewWorkflowButton("Start Workflow", blocks.NewWorkflow(trigger),
    blocks.WithWorkflowButtonStyle(blocks.ButtonStylePrimary),
)
Image Element

For use in section accessories or context blocks:

imageElem, _ := blocks.NewImageElement(
    "https://example.com/avatar.png",
    "User avatar",
)

Composition Objects

Text Objects
// Plain text (emoji enabled by default)
plain := blocks.MustPlainText("Hello :wave:")

// Plain text without emoji
plain := blocks.MustPlainText("Hello :wave:", blocks.WithEmoji(false))

// Markdown
md := blocks.MustMarkdown("*Bold* and _italic_")

// Markdown without auto-linking
md := blocks.MustMarkdown("example.com", blocks.WithVerbatim(true))
Option
option := blocks.MustOption("Display Text", "value",
    blocks.WithDescription("Additional info"),
)
Option Group
group := blocks.MustOptionGroup("Category",
    option1, option2, option3,
)
Confirm Dialog
confirm, _ := blocks.NewConfirmDialog(
    "Are you sure?",
    blocks.MustPlainText("This action cannot be undone."),
    "Yes, delete",
    "Cancel",
    blocks.WithConfirmStyle(blocks.ConfirmStyleDanger),
)
Conversation Filter
filter := blocks.NewConversationFilter(
    blocks.WithFilterInclude("public", "private"),
    blocks.WithFilterExcludeExternalSharedChannels(),
    blocks.WithFilterExcludeBotUsers(),
)
Dispatch Action Config
config := blocks.NewDispatchActionConfig(
    blocks.DispatchOnEnterPressed,
    blocks.DispatchOnCharacterEntered,
)

Error Handling

The library provides detailed validation errors:

button, err := blocks.NewButton("")
if err != nil {
    // err: "text: is required: missing required field"

    var validationErr blocks.ValidationError
    if errors.As(err, &validationErr) {
        fmt.Println(validationErr.Field)   // "text"
        fmt.Println(validationErr.Message) // "is required"
    }
}

Common error types:

  • ErrMissingRequired - Required field is empty
  • ErrExceedsMaxLen - String exceeds maximum length
  • ErrExceedsMaxItems - Array exceeds maximum items
  • ErrMinItems - Array has fewer than minimum items

JSON Output

All types implement json.Marshaler:

// Single block
data, _ := json.Marshal(button)

// Builder output
jsonData, _ := builder.JSON()         // {"blocks": [...]}
jsonData, _ := builder.PrettyJSON()   // Indented
jsonData, _ := builder.BlocksJSON()   // Just the array

// Surface output
data, _ := json.Marshal(modal)

Limits Reference

Component Limit
Blocks per message 50
Blocks per modal/home tab 100
Actions block elements 25
Context block elements 10
Section fields 10
Select options 100
Option groups 100
Modal title 24 characters
Button text 75 characters
Header text 150 characters

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyText         = errors.New("text cannot be empty")
	ErrExceedsMaxLen     = errors.New("exceeds maximum length")
	ErrInvalidFormat     = errors.New("invalid format")
	ErrMissingRequired   = errors.New("missing required field")
	ErrMutuallyExclusive = errors.New("mutually exclusive fields set")
	ErrExceedsMaxItems   = errors.New("exceeds maximum items")
	ErrMinItems          = errors.New("requires minimum items")
)

Sentinel errors for common validation failures.

Functions

func GenerateActionID

func GenerateActionID() string

GenerateActionID creates a unique action_id with "act" prefix.

func GenerateBlockID

func GenerateBlockID() string

GenerateBlockID creates a unique block_id with "blk" prefix.

func GenerateID

func GenerateID(prefix string) string

GenerateID creates a unique ID suitable for action_id or block_id. Format: prefix_timestamp_counter_random Ensures uniqueness across concurrent calls and process restarts.

Types

type Actions

type Actions struct {
	// contains filtered or unexported fields
}

Actions holds multiple interactive elements.

func NewActions

func NewActions(elements []ActionsElement, opts ...ActionsOption) (Actions, error)

NewActions creates an actions block. Max 25 elements.

func (Actions) MarshalJSON

func (a Actions) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type ActionsElement

type ActionsElement interface {
	json.Marshaler
	// contains filtered or unexported methods
}

ActionsElement marks elements valid in actions blocks. Valid types: Button, StaticSelect, MultiStaticSelect, ExternalSelect, MultiExternalSelect, UsersSelect, MultiUsersSelect, ConversationsSelect, MultiConversationsSelect, ChannelsSelect, MultiChannelsSelect, DatePicker, TimePicker, Checkboxes, RadioButtons, Overflow

type ActionsOption

type ActionsOption func(*Actions)

ActionsOption configures an Actions block.

func WithActionsBlockID

func WithActionsBlockID(id string) ActionsOption

WithActionsBlockID sets the block_id.

type Block

type Block interface {
	json.Marshaler
	// contains filtered or unexported methods
}

Block is the base interface for all top-level layout blocks. The unexported method seals the interface - only types in this package can implement it.

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

Builder provides a fluent API for building block collections.

func NewBuilder

func NewBuilder() *Builder

NewBuilder creates a new Builder.

func (*Builder) Add

func (b *Builder) Add(block Block) *Builder

Add adds a block to the builder.

func (*Builder) AddActions

func (b *Builder) AddActions(elements []ActionsElement, opts ...ActionsOption) *Builder

AddActions adds an actions block.

func (*Builder) AddContext

func (b *Builder) AddContext(elements []ContextElement, opts ...ContextOption) *Builder

AddContext adds a context block.

func (*Builder) AddDivider

func (b *Builder) AddDivider(opts ...DividerOption) *Builder

AddDivider adds a divider block.

func (*Builder) AddHeader

func (b *Builder) AddHeader(text string, opts ...HeaderOption) *Builder

AddHeader adds a header block.

func (*Builder) AddImage

func (b *Builder) AddImage(imageURL, altText string, opts ...ImageBlockOption) *Builder

AddImage adds an image block.

func (*Builder) AddInput

func (b *Builder) AddInput(label string, element InputElement, opts ...InputOption) *Builder

AddInput adds an input block.

func (*Builder) AddSection

func (b *Builder) AddSection(text TextObject, opts ...SectionOption) *Builder

AddSection adds a section block with text.

func (*Builder) AddSectionWithFields

func (b *Builder) AddSectionWithFields(fields []TextObject, opts ...SectionOption) *Builder

AddSectionWithFields adds a section block with fields.

func (*Builder) BlocksJSON

func (b *Builder) BlocksJSON() ([]byte, error)

BlocksJSON returns just the blocks array as JSON.

func (*Builder) Build

func (b *Builder) Build() ([]Block, error)

Build returns the blocks and any accumulated errors.

func (*Builder) Errors

func (b *Builder) Errors() []error

Errors returns any accumulated errors.

func (*Builder) HasErrors

func (b *Builder) HasErrors() bool

HasErrors returns true if there are any errors.

func (*Builder) JSON

func (b *Builder) JSON() ([]byte, error)

JSON returns the JSON representation of the blocks.

func (*Builder) MustBuild

func (b *Builder) MustBuild() []Block

MustBuild returns blocks or panics on error.

func (*Builder) MustToHomeTab

func (b *Builder) MustToHomeTab(opts ...HomeTabOption) HomeTab

MustToHomeTab converts to a home tab or panics on error.

func (*Builder) MustToMessage

func (b *Builder) MustToMessage(fallbackText string, opts ...MessageOption) Message

MustToMessage converts to a message or panics on error.

func (*Builder) MustToModal

func (b *Builder) MustToModal(title string, opts ...ModalOption) Modal

MustToModal converts to a modal or panics on error.

func (*Builder) PrettyJSON

func (b *Builder) PrettyJSON() ([]byte, error)

PrettyJSON returns indented JSON.

func (*Builder) ToHomeTab

func (b *Builder) ToHomeTab(opts ...HomeTabOption) (HomeTab, error)

ToHomeTab converts the blocks to a home tab.

func (*Builder) ToMessage

func (b *Builder) ToMessage(fallbackText string, opts ...MessageOption) (Message, error)

ToMessage converts the blocks to a message.

func (*Builder) ToModal

func (b *Builder) ToModal(title string, opts ...ModalOption) (Modal, error)

ToModal converts the blocks to a modal.

type Button

type Button struct {
	// contains filtered or unexported fields
}

Button represents an interactive button element.

func MustButton

func MustButton(text string, opts ...ButtonOption) Button

MustButton creates a Button or panics on error.

func NewButton

func NewButton(text string, opts ...ButtonOption) (Button, error)

NewButton creates a new Button with the given text. text max: 75 characters

func (Button) MarshalJSON

func (b Button) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type ButtonOption

type ButtonOption func(*Button)

ButtonOption configures a Button.

func WithAccessibilityLabel

func WithAccessibilityLabel(label string) ButtonOption

WithAccessibilityLabel sets a label for screen readers. Max 75 characters.

func WithActionID

func WithActionID(id string) ButtonOption

WithActionID sets the button's action_id. Max 255 characters.

func WithButtonConfirm

func WithButtonConfirm(confirm ConfirmDialog) ButtonOption

WithButtonConfirm adds a confirmation dialog to the button.

func WithButtonStyle

func WithButtonStyle(style ButtonStyle) ButtonOption

WithButtonStyle sets the button's visual style.

func WithURL

func WithURL(url string) ButtonOption

WithURL sets a URL to load when the button is clicked. Max 3000 characters.

func WithValue

func WithValue(value string) ButtonOption

WithValue sets the button's value sent in interaction payload. Max 2000 characters.

type ButtonStyle

type ButtonStyle string

ButtonStyle represents button visual styles.

const (
	ButtonStylePrimary ButtonStyle = "primary"
	ButtonStyleDanger  ButtonStyle = "danger"
)

type ChannelsSelect

type ChannelsSelect struct {
	// contains filtered or unexported fields
}

ChannelsSelect allows users to select a public channel.

func NewChannelsSelect

func NewChannelsSelect(opts ...ChannelsSelectOption) ChannelsSelect

NewChannelsSelect creates a channel select element.

func (ChannelsSelect) MarshalJSON

func (c ChannelsSelect) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type ChannelsSelectOption

type ChannelsSelectOption func(*ChannelsSelect)

ChannelsSelectOption configures a ChannelsSelect.

func WithChannelsSelectActionID

func WithChannelsSelectActionID(id string) ChannelsSelectOption

WithChannelsSelectActionID sets the action_id.

func WithChannelsSelectConfirm

func WithChannelsSelectConfirm(confirm ConfirmDialog) ChannelsSelectOption

WithChannelsSelectConfirm adds a confirmation dialog.

func WithChannelsSelectFocusOnLoad

func WithChannelsSelectFocusOnLoad() ChannelsSelectOption

WithChannelsSelectFocusOnLoad sets auto-focus.

func WithChannelsSelectPlaceholder

func WithChannelsSelectPlaceholder(text string) ChannelsSelectOption

WithChannelsSelectPlaceholder sets placeholder text.

func WithChannelsSelectResponseURLEnabled

func WithChannelsSelectResponseURLEnabled() ChannelsSelectOption

WithChannelsSelectResponseURLEnabled enables response URL for workflows.

func WithInitialChannel

func WithInitialChannel(channelID string) ChannelsSelectOption

WithInitialChannel sets the initially selected channel ID.

type Checkboxes

type Checkboxes struct {
	// contains filtered or unexported fields
}

Checkboxes allows users to choose multiple items from a list.

func NewCheckboxes

func NewCheckboxes(options []Option, opts ...CheckboxesOption) (Checkboxes, error)

NewCheckboxes creates a new checkboxes element. Max 10 options.

func (Checkboxes) MarshalJSON

func (c Checkboxes) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type CheckboxesOption

type CheckboxesOption func(*Checkboxes)

CheckboxesOption configures a Checkboxes element.

func WithCheckboxesActionID

func WithCheckboxesActionID(id string) CheckboxesOption

WithCheckboxesActionID sets the action_id.

func WithCheckboxesConfirm

func WithCheckboxesConfirm(confirm ConfirmDialog) CheckboxesOption

WithCheckboxesConfirm adds a confirmation dialog.

func WithCheckboxesFocusOnLoad

func WithCheckboxesFocusOnLoad() CheckboxesOption

WithCheckboxesFocusOnLoad sets auto-focus.

func WithInitialOptions

func WithInitialOptions(options ...Option) CheckboxesOption

WithInitialOptions sets initially selected options.

type ConfirmDialog

type ConfirmDialog struct {
	// contains filtered or unexported fields
}

ConfirmDialog represents a confirmation dialog composition object. Adds a confirmation step to interactive elements.

func NewConfirmDialog

func NewConfirmDialog(title, text, confirm, deny string, opts ...ConfirmDialogOption) (ConfirmDialog, error)

NewConfirmDialog creates a new confirmation dialog. title max: 100 chars, text max: 300 chars, confirm/deny max: 30 chars

func NewConfirmDialogWithMarkdown

func NewConfirmDialogWithMarkdown(title, text, confirm, deny string, opts ...ConfirmDialogOption) (ConfirmDialog, error)

NewConfirmDialogWithMarkdown creates a confirm dialog with markdown text.

func (ConfirmDialog) MarshalJSON

func (c ConfirmDialog) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type ConfirmDialogOption

type ConfirmDialogOption func(*ConfirmDialog)

ConfirmDialogOption configures a ConfirmDialog.

func WithConfirmStyle

func WithConfirmStyle(style ConfirmStyle) ConfirmDialogOption

WithConfirmStyle sets the style of the confirm button.

type ConfirmStyle

type ConfirmStyle string

ConfirmStyle represents the style of the confirm button.

const (
	ConfirmStylePrimary ConfirmStyle = "primary"
	ConfirmStyleDanger  ConfirmStyle = "danger"
)

type Context

type Context struct {
	// contains filtered or unexported fields
}

Context displays contextual information. Elements can be images and text (PlainText or Markdown).

func NewContext

func NewContext(elements []ContextElement, opts ...ContextOption) (Context, error)

NewContext creates a new context block. Max 10 elements.

func (Context) MarshalJSON

func (c Context) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type ContextActions

type ContextActions struct {
	// contains filtered or unexported fields
}

ContextActions displays actions as contextual information. Available in messages only. Contains feedback buttons and icon buttons.

func MustContextActions

func MustContextActions(elements []ContextActionsElement, opts ...ContextActionsOption) ContextActions

MustContextActions creates a ContextActions or panics on error.

func NewContextActions

func NewContextActions(elements []ContextActionsElement, opts ...ContextActionsOption) (ContextActions, error)

NewContextActions creates a new context actions block. elements: 1-5 elements (FeedbackButtons, IconButton)

func (ContextActions) MarshalJSON

func (c ContextActions) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type ContextActionsElement

type ContextActionsElement interface {
	json.Marshaler
	// contains filtered or unexported methods
}

ContextActionsElement marks elements valid in context actions blocks. Valid types: FeedbackButtons, IconButton

type ContextActionsOption

type ContextActionsOption func(*ContextActions)

ContextActionsOption configures a ContextActions block.

func WithContextActionsBlockID

func WithContextActionsBlockID(id string) ContextActionsOption

WithContextActionsBlockID sets the block_id.

type ContextElement

type ContextElement interface {
	json.Marshaler
	// contains filtered or unexported methods
}

ContextElement marks elements valid in context blocks. Valid types: ImageElement, PlainText, Markdown

type ContextOption

type ContextOption func(*Context)

ContextOption configures a Context.

func WithContextBlockID

func WithContextBlockID(id string) ContextOption

WithContextBlockID sets the block_id.

type ConversationFilter

type ConversationFilter struct {
	// contains filtered or unexported fields
}

ConversationFilter provides filtering for conversation selector menus.

func NewConversationFilter

func NewConversationFilter(opts ...ConversationFilterOption) (ConversationFilter, error)

NewConversationFilter creates a new conversation filter. At least one option must be set.

func (ConversationFilter) MarshalJSON

func (f ConversationFilter) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type ConversationFilterOption

type ConversationFilterOption func(*ConversationFilter)

ConversationFilterOption configures a ConversationFilter.

func WithExcludeBotUsers

func WithExcludeBotUsers() ConversationFilterOption

WithExcludeBotUsers excludes bot users.

func WithExcludeExternalSharedChannels

func WithExcludeExternalSharedChannels() ConversationFilterOption

WithExcludeExternalSharedChannels excludes external shared channels.

func WithInclude

func WithInclude(types ...ConversationType) ConversationFilterOption

WithInclude specifies which conversation types to include.

type ConversationType

type ConversationType string

ConversationType represents types of conversations to include in filter.

const (
	ConversationIM      ConversationType = "im"
	ConversationMPIM    ConversationType = "mpim"
	ConversationPrivate ConversationType = "private"
	ConversationPublic  ConversationType = "public"
)

type ConversationsSelect

type ConversationsSelect struct {
	// contains filtered or unexported fields
}

ConversationsSelect allows users to select a conversation.

func NewConversationsSelect

func NewConversationsSelect(opts ...ConversationsSelectOption) ConversationsSelect

NewConversationsSelect creates a conversation select element.

func (ConversationsSelect) MarshalJSON

func (c ConversationsSelect) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type ConversationsSelectOption

type ConversationsSelectOption func(*ConversationsSelect)

ConversationsSelectOption configures a ConversationsSelect.

func WithConversationsFilter

func WithConversationsFilter(filter ConversationFilter) ConversationsSelectOption

WithConversationsFilter sets a filter for the conversation list.

func WithConversationsSelectActionID

func WithConversationsSelectActionID(id string) ConversationsSelectOption

WithConversationsSelectActionID sets the action_id.

func WithConversationsSelectConfirm

func WithConversationsSelectConfirm(confirm ConfirmDialog) ConversationsSelectOption

WithConversationsSelectConfirm adds a confirmation dialog.

func WithConversationsSelectFocusOnLoad

func WithConversationsSelectFocusOnLoad() ConversationsSelectOption

WithConversationsSelectFocusOnLoad sets auto-focus.

func WithConversationsSelectPlaceholder

func WithConversationsSelectPlaceholder(text string) ConversationsSelectOption

WithConversationsSelectPlaceholder sets placeholder text.

func WithDefaultToCurrentConversation

func WithDefaultToCurrentConversation() ConversationsSelectOption

WithDefaultToCurrentConversation defaults to current conversation.

func WithInitialConversation

func WithInitialConversation(conversationID string) ConversationsSelectOption

WithInitialConversation sets the initially selected conversation ID.

func WithResponseURLEnabled

func WithResponseURLEnabled() ConversationsSelectOption

WithResponseURLEnabled enables response URL for workflows.

type DatePicker

type DatePicker struct {
	// contains filtered or unexported fields
}

DatePicker allows users to select a date from a calendar UI.

func NewDatePicker

func NewDatePicker(opts ...DatePickerOption) DatePicker

NewDatePicker creates a new date picker element.

func (DatePicker) MarshalJSON

func (d DatePicker) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type DatePickerOption

type DatePickerOption func(*DatePicker)

DatePickerOption configures a DatePicker.

func WithDatePickerActionID

func WithDatePickerActionID(id string) DatePickerOption

WithDatePickerActionID sets the action_id.

func WithDatePickerConfirm

func WithDatePickerConfirm(confirm ConfirmDialog) DatePickerOption

WithDatePickerConfirm adds a confirmation dialog.

func WithDatePickerFocusOnLoad

func WithDatePickerFocusOnLoad() DatePickerOption

WithDatePickerFocusOnLoad sets auto-focus.

func WithDatePickerPlaceholder

func WithDatePickerPlaceholder(text string) DatePickerOption

WithDatePickerPlaceholder sets placeholder text. Max 150 characters.

func WithInitialDate

func WithInitialDate(date string) DatePickerOption

WithInitialDate sets the initially selected date. Format: YYYY-MM-DD

type DatetimePicker

type DatetimePicker struct {
	// contains filtered or unexported fields
}

DatetimePicker allows users to select both date and time.

func NewDatetimePicker

func NewDatetimePicker(opts ...DatetimePickerOption) DatetimePicker

NewDatetimePicker creates a new datetime picker element.

func (DatetimePicker) MarshalJSON

func (d DatetimePicker) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type DatetimePickerOption

type DatetimePickerOption func(*DatetimePicker)

DatetimePickerOption configures a DatetimePicker.

func WithDatetimePickerActionID

func WithDatetimePickerActionID(id string) DatetimePickerOption

WithDatetimePickerActionID sets the action_id.

func WithDatetimePickerConfirm

func WithDatetimePickerConfirm(confirm ConfirmDialog) DatetimePickerOption

WithDatetimePickerConfirm adds a confirmation dialog.

func WithDatetimePickerFocusOnLoad

func WithDatetimePickerFocusOnLoad() DatetimePickerOption

WithDatetimePickerFocusOnLoad sets auto-focus.

func WithInitialDateTime

func WithInitialDateTime(timestamp int64) DatetimePickerOption

WithInitialDateTime sets the initial date/time as Unix timestamp.

type DispatchActionConfig

type DispatchActionConfig struct {
	// contains filtered or unexported fields
}

DispatchActionConfig defines when a plain-text input dispatches actions.

func NewDispatchActionConfig

func NewDispatchActionConfig(triggers ...TriggerAction) DispatchActionConfig

NewDispatchActionConfig creates a new dispatch action configuration.

func (DispatchActionConfig) MarshalJSON

func (d DispatchActionConfig) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type Divider

type Divider struct {
	// contains filtered or unexported fields
}

Divider is a visual separator between blocks.

func NewDivider

func NewDivider(opts ...DividerOption) Divider

NewDivider creates a new divider block.

func (Divider) MarshalJSON

func (d Divider) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type DividerOption

type DividerOption func(*Divider)

DividerOption configures a Divider.

func WithDividerBlockID

func WithDividerBlockID(id string) DividerOption

WithDividerBlockID sets the block_id.

type EmailInput

type EmailInput struct {
	// contains filtered or unexported fields
}

EmailInput allows users to enter an email into a single-line field.

func NewEmailInput

func NewEmailInput(opts ...EmailInputOption) EmailInput

NewEmailInput creates a new email input element.

func (EmailInput) MarshalJSON

func (e EmailInput) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type EmailInputOption

type EmailInputOption func(*EmailInput)

EmailInputOption configures an EmailInput.

func WithEmailInputActionID

func WithEmailInputActionID(id string) EmailInputOption

WithEmailInputActionID sets the action_id.

func WithEmailInputDispatchActionConfig

func WithEmailInputDispatchActionConfig(config DispatchActionConfig) EmailInputOption

WithEmailInputDispatchActionConfig sets when to dispatch block_actions.

func WithEmailInputFocusOnLoad

func WithEmailInputFocusOnLoad() EmailInputOption

WithEmailInputFocusOnLoad sets auto-focus.

func WithEmailInputInitialValue

func WithEmailInputInitialValue(value string) EmailInputOption

WithEmailInputInitialValue sets the initial email value.

func WithEmailInputPlaceholder

func WithEmailInputPlaceholder(text string) EmailInputOption

WithEmailInputPlaceholder sets placeholder text. Max 150 characters.

type ExternalSelect

type ExternalSelect struct {
	// contains filtered or unexported fields
}

ExternalSelect allows users to choose from options loaded from an external source.

func NewExternalSelect

func NewExternalSelect(opts ...ExternalSelectOption) ExternalSelect

NewExternalSelect creates an external data source select.

func (ExternalSelect) MarshalJSON

func (e ExternalSelect) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type ExternalSelectOption

type ExternalSelectOption func(*ExternalSelect)

ExternalSelectOption configures an ExternalSelect.

func WithExternalSelectActionID

func WithExternalSelectActionID(id string) ExternalSelectOption

WithExternalSelectActionID sets the action_id.

func WithExternalSelectConfirm

func WithExternalSelectConfirm(confirm ConfirmDialog) ExternalSelectOption

WithExternalSelectConfirm adds a confirmation dialog.

func WithExternalSelectFocusOnLoad

func WithExternalSelectFocusOnLoad() ExternalSelectOption

WithExternalSelectFocusOnLoad sets auto-focus.

func WithExternalSelectInitialOption

func WithExternalSelectInitialOption(option Option) ExternalSelectOption

WithExternalSelectInitialOption sets the initially selected option.

func WithExternalSelectPlaceholder

func WithExternalSelectPlaceholder(text string) ExternalSelectOption

WithExternalSelectPlaceholder sets placeholder text.

func WithMinQueryLength

func WithMinQueryLength(length int) ExternalSelectOption

WithMinQueryLength sets minimum characters before querying.

type FeedbackButtons

type FeedbackButtons struct {
	// contains filtered or unexported fields
}

FeedbackButtons displays buttons to indicate positive or negative feedback. Used in context actions blocks for AI/assistant responses.

func NewFeedbackButtons

func NewFeedbackButtons(opts ...FeedbackButtonsOption) FeedbackButtons

NewFeedbackButtons creates a new feedback buttons element.

func (FeedbackButtons) MarshalJSON

func (f FeedbackButtons) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type FeedbackButtonsOption

type FeedbackButtonsOption func(*FeedbackButtons)

FeedbackButtonsOption configures FeedbackButtons.

func WithFeedbackButtonsActionID

func WithFeedbackButtonsActionID(id string) FeedbackButtonsOption

WithFeedbackButtonsActionID sets the action_id.

type File

type File struct {
	// contains filtered or unexported fields
}

File displays information about a remote file. This block appears when retrieving messages that contain remote files. You cannot add this block directly to messages.

func MustFile

func MustFile(externalID string, opts ...FileOption) File

MustFile creates a File or panics on error.

func NewFile

func NewFile(externalID string, opts ...FileOption) (File, error)

NewFile creates a new file block. externalID is the external unique ID for the file. source is always "remote" for remote files.

func (File) MarshalJSON

func (f File) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type FileInput

type FileInput struct {
	// contains filtered or unexported fields
}

FileInput allows users to upload files.

func NewFileInput

func NewFileInput(opts ...FileInputOption) FileInput

NewFileInput creates a new file input element.

func (FileInput) MarshalJSON

func (f FileInput) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type FileInputOption

type FileInputOption func(*FileInput)

FileInputOption configures a FileInput.

func WithFileInputActionID

func WithFileInputActionID(id string) FileInputOption

WithFileInputActionID sets the action_id.

func WithFileInputFiletypes

func WithFileInputFiletypes(filetypes []string) FileInputOption

WithFileInputFiletypes sets the allowed file types. Example: []string{"pdf", "doc", "docx"}

func WithFileInputMaxFiles

func WithFileInputMaxFiles(max int) FileInputOption

WithFileInputMaxFiles sets the maximum number of files. Minimum 1, maximum 10. Defaults to 10 if not specified.

type FileOption

type FileOption func(*File)

FileOption configures a File block.

func WithFileBlockID

func WithFileBlockID(id string) FileOption

WithFileBlockID sets the block_id.

type Header struct {
	// contains filtered or unexported fields
}

Header displays larger-sized text.

func MustHeader

func MustHeader(text string, opts ...HeaderOption) Header

MustHeader creates a Header or panics on error.

func NewHeader

func NewHeader(text string, opts ...HeaderOption) (Header, error)

NewHeader creates a new header block. text max: 150 characters, must be plain_text

func (Header) MarshalJSON

func (h Header) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type HeaderOption

type HeaderOption func(*Header)

HeaderOption configures a Header.

func WithHeaderBlockID

func WithHeaderBlockID(id string) HeaderOption

WithHeaderBlockID sets the block_id.

type HomeTab

type HomeTab struct {
	// contains filtered or unexported fields
}

HomeTab represents the App Home tab surface.

func MustHomeTab

func MustHomeTab(blocks []Block, opts ...HomeTabOption) HomeTab

MustHomeTab creates a HomeTab or panics on error.

func NewHomeTab

func NewHomeTab(blocks []Block, opts ...HomeTabOption) (HomeTab, error)

NewHomeTab creates a new home tab. max 100 blocks

func (HomeTab) MarshalJSON

func (h HomeTab) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type HomeTabOption

type HomeTabOption func(*HomeTab)

HomeTabOption configures a HomeTab.

func WithHomeTabCallbackID

func WithHomeTabCallbackID(id string) HomeTabOption

WithHomeTabCallbackID sets the callback ID. Max 255 characters.

func WithHomeTabExternalID

func WithHomeTabExternalID(id string) HomeTabOption

WithHomeTabExternalID sets an external ID.

func WithHomeTabPrivateMetadata

func WithHomeTabPrivateMetadata(metadata string) HomeTabOption

WithHomeTabPrivateMetadata sets private metadata. Max 3000 characters.

type Icon

type Icon struct {
	// contains filtered or unexported fields
}

Icon represents an icon for the icon button.

func NewIcon

func NewIcon(name string) Icon

NewIcon creates a new icon with the given name.

func (Icon) MarshalJSON

func (i Icon) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler for Icon.

type IconButton

type IconButton struct {
	// contains filtered or unexported fields
}

IconButton displays an icon button for performing actions. Used in context actions blocks.

func NewIconButton

func NewIconButton(icon Icon, opts ...IconButtonOption) IconButton

NewIconButton creates a new icon button element.

func (IconButton) MarshalJSON

func (b IconButton) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type IconButtonOption

type IconButtonOption func(*IconButton)

IconButtonOption configures an IconButton.

func WithIconButtonActionID

func WithIconButtonActionID(id string) IconButtonOption

WithIconButtonActionID sets the action_id.

func WithIconButtonAltText

func WithIconButtonAltText(text string) IconButtonOption

WithIconButtonAltText sets the alt text for accessibility.

type ImageBlock

type ImageBlock struct {
	// contains filtered or unexported fields
}

ImageBlock displays an image.

func NewImageBlock

func NewImageBlock(imageURL, altText string, opts ...ImageBlockOption) (ImageBlock, error)

NewImageBlock creates an image block from a URL. imageURL max: 3000 chars, altText max: 2000 chars

func NewImageBlockFromSlackFile

func NewImageBlockFromSlackFile(slackFile SlackFile, altText string, opts ...ImageBlockOption) (ImageBlock, error)

NewImageBlockFromSlackFile creates an image block from a Slack file.

func (ImageBlock) MarshalJSON

func (i ImageBlock) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type ImageBlockOption

type ImageBlockOption func(*ImageBlock)

ImageBlockOption configures an ImageBlock.

func WithImageBlockID

func WithImageBlockID(id string) ImageBlockOption

WithImageBlockID sets the block_id.

func WithImageBlockTitle

func WithImageBlockTitle(title string) ImageBlockOption

WithImageBlockTitle sets the image title. Max 2000 characters.

type ImageElement

type ImageElement struct {
	// contains filtered or unexported fields
}

ImageElement represents an image element for use in section/context blocks.

func NewImageElement

func NewImageElement(imageURL, altText string) (ImageElement, error)

NewImageElement creates an image element from a URL. imageURL max: 3000 chars, altText max: 2000 chars

func NewImageElementFromSlackFile

func NewImageElementFromSlackFile(slackFile SlackFile, altText string) (ImageElement, error)

NewImageElementFromSlackFile creates an image element from a Slack file.

func (ImageElement) MarshalJSON

func (i ImageElement) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type ImageElementOption

type ImageElementOption func(*ImageElement)

ImageElementOption configures an ImageElement.

type Input

type Input struct {
	// contains filtered or unexported fields
}

Input collects information from users via input elements.

func MustInput

func MustInput(label string, element InputElement, opts ...InputOption) Input

MustInput creates an Input or panics on error.

func NewInput

func NewInput(label string, element InputElement, opts ...InputOption) (Input, error)

NewInput creates an input block with required label and element. label max: 2000 characters

func (Input) MarshalJSON

func (i Input) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type InputElement

type InputElement interface {
	json.Marshaler
	// contains filtered or unexported methods
}

InputElement marks elements valid in input blocks. Valid types: PlainTextInput, StaticSelect, MultiStaticSelect, ExternalSelect, MultiExternalSelect, UsersSelect, MultiUsersSelect, ConversationsSelect, MultiConversationsSelect, ChannelsSelect, MultiChannelsSelect, DatePicker, TimePicker, DatetimePicker, Checkboxes, RadioButtons, EmailInput, NumberInput, URLInput, FileInput, RichTextInput

type InputOption

type InputOption func(*Input)

InputOption configures an Input block.

func AsInputOptional

func AsInputOptional() InputOption

AsInputOptional marks the input as optional.

func WithInputBlockID

func WithInputBlockID(id string) InputOption

WithInputBlockID sets the block_id.

func WithInputDispatchAction

func WithInputDispatchAction() InputOption

WithInputDispatchAction enables block_actions dispatch.

func WithInputHint

func WithInputHint(hint string) InputOption

WithInputHint adds a hint below the input. Max 2000 characters.

type InputParameter

type InputParameter struct {
	// contains filtered or unexported fields
}

InputParameter defines an input parameter for workflow triggers.

func MustInputParameter

func MustInputParameter(name, value string) InputParameter

MustInputParameter creates an InputParameter or panics on error.

func NewInputParameter

func NewInputParameter(name, value string) (InputParameter, error)

NewInputParameter creates a new input parameter.

func (InputParameter) MarshalJSON

func (p InputParameter) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type Markdown

type Markdown struct {
	// contains filtered or unexported fields
}

Markdown represents a mrkdwn composition object.

func MustMarkdown

func MustMarkdown(text string, opts ...MarkdownOption) Markdown

MustMarkdown creates a Markdown or panics on error.

func NewMarkdown

func NewMarkdown(text string, opts ...MarkdownOption) (Markdown, error)

NewMarkdown creates a new Markdown text object.

func (Markdown) MarshalJSON

func (m Markdown) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (Markdown) Text

func (m Markdown) Text() string

Text returns the text content.

type MarkdownBlock

type MarkdownBlock struct {
	// contains filtered or unexported fields
}

MarkdownBlock displays formatted markdown content. Available in messages only.

func MustMarkdownBlock

func MustMarkdownBlock(text string, opts ...MarkdownBlockOption) MarkdownBlock

MustMarkdownBlock creates a MarkdownBlock or panics on error.

func NewMarkdownBlock

func NewMarkdownBlock(text string, opts ...MarkdownBlockOption) (MarkdownBlock, error)

NewMarkdownBlock creates a new markdown block.

func (MarkdownBlock) MarshalJSON

func (m MarkdownBlock) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type MarkdownBlockOption

type MarkdownBlockOption func(*MarkdownBlock)

MarkdownBlockOption configures a MarkdownBlock.

func WithMarkdownBlockID

func WithMarkdownBlockID(id string) MarkdownBlockOption

WithMarkdownBlockID sets the block_id.

type MarkdownOption

type MarkdownOption func(*Markdown)

MarkdownOption configures a Markdown.

func WithVerbatim

func WithVerbatim(verbatim bool) MarkdownOption

WithVerbatim disables automatic parsing of URLs, mentions, and emoji.

type Message

type Message struct {
	// contains filtered or unexported fields
}

Message represents a message surface.

func MustMessage

func MustMessage(text string, blocks []Block, opts ...MessageOption) Message

MustMessage creates a Message or panics on error.

func NewMessage

func NewMessage(text string, blocks []Block, opts ...MessageOption) (Message, error)

NewMessage creates a new message. text is fallback for notifications, max 50 blocks

func NewMessageWithBlocks

func NewMessageWithBlocks(blocks []Block, opts ...MessageOption) (Message, error)

NewMessageWithBlocks creates a message with blocks only.

func (Message) Blocks

func (m Message) Blocks() []Block

Blocks returns the message blocks.

func (Message) MarshalJSON

func (m Message) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type MessageOption

type MessageOption func(*Message)

MessageOption configures a Message.

func WithMessageMrkdwn

func WithMessageMrkdwn() MessageOption

WithMessageMrkdwn enables markdown parsing for the text.

func WithMessageThreadTS

func WithMessageThreadTS(ts string) MessageOption

WithMessageThreadTS sets the thread timestamp for replies.

type Modal struct {
	// contains filtered or unexported fields
}

Modal represents a modal dialog surface.

func MustModal

func MustModal(title string, blocks []Block, opts ...ModalOption) Modal

MustModal creates a Modal or panics on error.

func NewModal

func NewModal(title string, blocks []Block, opts ...ModalOption) (Modal, error)

NewModal creates a new modal. title max: 24 characters, max 100 blocks

func (Modal) MarshalJSON

func (m Modal) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type ModalOption

type ModalOption func(*Modal)

ModalOption configures a Modal.

func WithModalCallbackID

func WithModalCallbackID(id string) ModalOption

WithModalCallbackID sets the callback ID. Max 255 characters.

func WithModalClearOnClose

func WithModalClearOnClose() ModalOption

WithModalClearOnClose clears all views when closed.

func WithModalClose

func WithModalClose(text string) ModalOption

WithModalClose sets the close button text. Max 24 characters.

func WithModalExternalID

func WithModalExternalID(id string) ModalOption

WithModalExternalID sets an external ID.

func WithModalNotifyOnClose

func WithModalNotifyOnClose() ModalOption

WithModalNotifyOnClose sends view_closed event when closed.

func WithModalPrivateMetadata

func WithModalPrivateMetadata(metadata string) ModalOption

WithModalPrivateMetadata sets private metadata. Max 3000 characters.

func WithModalSubmit

func WithModalSubmit(text string) ModalOption

WithModalSubmit sets the submit button text. Max 24 characters.

func WithModalSubmitDisabled

func WithModalSubmitDisabled() ModalOption

WithModalSubmitDisabled disables the submit button.

type MultiChannelsSelect

type MultiChannelsSelect struct {
	// contains filtered or unexported fields
}

MultiChannelsSelect allows selecting multiple public channels.

func NewMultiChannelsSelect

func NewMultiChannelsSelect(opts ...MultiChannelsSelectOption) MultiChannelsSelect

NewMultiChannelsSelect creates a multi-channel select element.

func (MultiChannelsSelect) MarshalJSON

func (m MultiChannelsSelect) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type MultiChannelsSelectOption

type MultiChannelsSelectOption func(*MultiChannelsSelect)

MultiChannelsSelectOption configures a MultiChannelsSelect.

func WithInitialChannels

func WithInitialChannels(channelIDs ...string) MultiChannelsSelectOption

WithInitialChannels sets initially selected channel IDs.

func WithMultiChannelsSelectActionID

func WithMultiChannelsSelectActionID(id string) MultiChannelsSelectOption

WithMultiChannelsSelectActionID sets the action_id.

func WithMultiChannelsSelectConfirm

func WithMultiChannelsSelectConfirm(confirm ConfirmDialog) MultiChannelsSelectOption

WithMultiChannelsSelectConfirm adds a confirmation dialog.

func WithMultiChannelsSelectFocusOnLoad

func WithMultiChannelsSelectFocusOnLoad() MultiChannelsSelectOption

WithMultiChannelsSelectFocusOnLoad sets auto-focus.

func WithMultiChannelsSelectMaxItems

func WithMultiChannelsSelectMaxItems(max int) MultiChannelsSelectOption

WithMultiChannelsSelectMaxItems sets max selectable items.

func WithMultiChannelsSelectPlaceholder

func WithMultiChannelsSelectPlaceholder(text string) MultiChannelsSelectOption

WithMultiChannelsSelectPlaceholder sets placeholder text.

type MultiConversationsSelect

type MultiConversationsSelect struct {
	// contains filtered or unexported fields
}

MultiConversationsSelect allows selecting multiple conversations.

func NewMultiConversationsSelect

func NewMultiConversationsSelect(opts ...MultiConversationsSelectOption) MultiConversationsSelect

NewMultiConversationsSelect creates a multi-conversation select element.

func (MultiConversationsSelect) MarshalJSON

func (m MultiConversationsSelect) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type MultiConversationsSelectOption

type MultiConversationsSelectOption func(*MultiConversationsSelect)

MultiConversationsSelectOption configures a MultiConversationsSelect.

func WithInitialConversations

func WithInitialConversations(conversationIDs ...string) MultiConversationsSelectOption

WithInitialConversations sets initially selected conversation IDs.

func WithMultiConversationsDefaultToCurrentConversation

func WithMultiConversationsDefaultToCurrentConversation() MultiConversationsSelectOption

WithMultiConversationsDefaultToCurrentConversation defaults to current.

func WithMultiConversationsFilter

func WithMultiConversationsFilter(filter ConversationFilter) MultiConversationsSelectOption

WithMultiConversationsFilter sets a filter for the conversation list.

func WithMultiConversationsSelectActionID

func WithMultiConversationsSelectActionID(id string) MultiConversationsSelectOption

WithMultiConversationsSelectActionID sets the action_id.

func WithMultiConversationsSelectConfirm

func WithMultiConversationsSelectConfirm(confirm ConfirmDialog) MultiConversationsSelectOption

WithMultiConversationsSelectConfirm adds a confirmation dialog.

func WithMultiConversationsSelectFocusOnLoad

func WithMultiConversationsSelectFocusOnLoad() MultiConversationsSelectOption

WithMultiConversationsSelectFocusOnLoad sets auto-focus.

func WithMultiConversationsSelectMaxItems

func WithMultiConversationsSelectMaxItems(max int) MultiConversationsSelectOption

WithMultiConversationsSelectMaxItems sets max selectable items.

func WithMultiConversationsSelectPlaceholder

func WithMultiConversationsSelectPlaceholder(text string) MultiConversationsSelectOption

WithMultiConversationsSelectPlaceholder sets placeholder text.

type MultiExternalSelect

type MultiExternalSelect struct {
	// contains filtered or unexported fields
}

MultiExternalSelect allows multiple selections from an external source.

func NewMultiExternalSelect

func NewMultiExternalSelect(opts ...MultiExternalSelectOption) MultiExternalSelect

NewMultiExternalSelect creates a multi-select with external data source.

func (MultiExternalSelect) MarshalJSON

func (m MultiExternalSelect) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type MultiExternalSelectOption

type MultiExternalSelectOption func(*MultiExternalSelect)

MultiExternalSelectOption configures a MultiExternalSelect.

func WithMultiExternalSelectActionID

func WithMultiExternalSelectActionID(id string) MultiExternalSelectOption

WithMultiExternalSelectActionID sets the action_id.

func WithMultiExternalSelectConfirm

func WithMultiExternalSelectConfirm(confirm ConfirmDialog) MultiExternalSelectOption

WithMultiExternalSelectConfirm adds a confirmation dialog.

func WithMultiExternalSelectFocusOnLoad

func WithMultiExternalSelectFocusOnLoad() MultiExternalSelectOption

WithMultiExternalSelectFocusOnLoad sets auto-focus.

func WithMultiExternalSelectInitialOptions

func WithMultiExternalSelectInitialOptions(options ...Option) MultiExternalSelectOption

WithMultiExternalSelectInitialOptions sets initially selected options.

func WithMultiExternalSelectMaxItems

func WithMultiExternalSelectMaxItems(max int) MultiExternalSelectOption

WithMultiExternalSelectMaxItems sets max selectable items.

func WithMultiExternalSelectMinQueryLength

func WithMultiExternalSelectMinQueryLength(length int) MultiExternalSelectOption

WithMultiExternalSelectMinQueryLength sets minimum characters before querying.

func WithMultiExternalSelectPlaceholder

func WithMultiExternalSelectPlaceholder(text string) MultiExternalSelectOption

WithMultiExternalSelectPlaceholder sets placeholder text.

type MultiStaticSelect

type MultiStaticSelect struct {
	// contains filtered or unexported fields
}

MultiStaticSelect allows users to choose multiple options from a static list.

func NewMultiStaticSelect

func NewMultiStaticSelect(options []Option, opts ...MultiStaticSelectOption) (MultiStaticSelect, error)

NewMultiStaticSelect creates a multi-select with options.

func NewMultiStaticSelectWithGroups

func NewMultiStaticSelectWithGroups(groups []OptionGroup, opts ...MultiStaticSelectOption) (MultiStaticSelect, error)

NewMultiStaticSelectWithGroups creates a multi-select with option groups.

func (MultiStaticSelect) MarshalJSON

func (m MultiStaticSelect) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type MultiStaticSelectOption

type MultiStaticSelectOption func(*MultiStaticSelect)

MultiStaticSelectOption configures a MultiStaticSelect.

func WithMultiStaticSelectActionID

func WithMultiStaticSelectActionID(id string) MultiStaticSelectOption

WithMultiStaticSelectActionID sets the action_id.

func WithMultiStaticSelectConfirm

func WithMultiStaticSelectConfirm(confirm ConfirmDialog) MultiStaticSelectOption

WithMultiStaticSelectConfirm adds a confirmation dialog.

func WithMultiStaticSelectFocusOnLoad

func WithMultiStaticSelectFocusOnLoad() MultiStaticSelectOption

WithMultiStaticSelectFocusOnLoad sets auto-focus.

func WithMultiStaticSelectInitialOptions

func WithMultiStaticSelectInitialOptions(options ...Option) MultiStaticSelectOption

WithMultiStaticSelectInitialOptions sets initially selected options.

func WithMultiStaticSelectMaxItems

func WithMultiStaticSelectMaxItems(max int) MultiStaticSelectOption

WithMultiStaticSelectMaxItems sets max selectable items.

func WithMultiStaticSelectPlaceholder

func WithMultiStaticSelectPlaceholder(text string) MultiStaticSelectOption

WithMultiStaticSelectPlaceholder sets placeholder text.

type MultiUsersSelect

type MultiUsersSelect struct {
	// contains filtered or unexported fields
}

MultiUsersSelect allows selecting multiple users.

func NewMultiUsersSelect

func NewMultiUsersSelect(opts ...MultiUsersSelectOption) MultiUsersSelect

NewMultiUsersSelect creates a multi-user select element.

func (MultiUsersSelect) MarshalJSON

func (m MultiUsersSelect) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type MultiUsersSelectOption

type MultiUsersSelectOption func(*MultiUsersSelect)

MultiUsersSelectOption configures a MultiUsersSelect.

func WithInitialUsers

func WithInitialUsers(userIDs ...string) MultiUsersSelectOption

WithInitialUsers sets initially selected user IDs.

func WithMultiUsersSelectActionID

func WithMultiUsersSelectActionID(id string) MultiUsersSelectOption

WithMultiUsersSelectActionID sets the action_id.

func WithMultiUsersSelectConfirm

func WithMultiUsersSelectConfirm(confirm ConfirmDialog) MultiUsersSelectOption

WithMultiUsersSelectConfirm adds a confirmation dialog.

func WithMultiUsersSelectFocusOnLoad

func WithMultiUsersSelectFocusOnLoad() MultiUsersSelectOption

WithMultiUsersSelectFocusOnLoad sets auto-focus.

func WithMultiUsersSelectMaxItems

func WithMultiUsersSelectMaxItems(max int) MultiUsersSelectOption

WithMultiUsersSelectMaxItems sets max selectable items.

func WithMultiUsersSelectPlaceholder

func WithMultiUsersSelectPlaceholder(text string) MultiUsersSelectOption

WithMultiUsersSelectPlaceholder sets placeholder text.

type NumberInput

type NumberInput struct {
	// contains filtered or unexported fields
}

NumberInput allows users to enter a number into a single-line field.

func NewNumberInput

func NewNumberInput(isDecimalAllowed bool, opts ...NumberInputOption) NumberInput

NewNumberInput creates a new number input element. isDecimalAllowed specifies whether decimal numbers are allowed.

func (NumberInput) MarshalJSON

func (n NumberInput) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type NumberInputOption

type NumberInputOption func(*NumberInput)

NumberInputOption configures a NumberInput.

func WithNumberInputActionID

func WithNumberInputActionID(id string) NumberInputOption

WithNumberInputActionID sets the action_id.

func WithNumberInputDispatchActionConfig

func WithNumberInputDispatchActionConfig(config DispatchActionConfig) NumberInputOption

WithNumberInputDispatchActionConfig sets when to dispatch block_actions.

func WithNumberInputFocusOnLoad

func WithNumberInputFocusOnLoad() NumberInputOption

WithNumberInputFocusOnLoad sets auto-focus.

func WithNumberInputInitialValue

func WithNumberInputInitialValue(value string) NumberInputOption

WithNumberInputInitialValue sets the initial number value.

func WithNumberInputMaxValue

func WithNumberInputMaxValue(value string) NumberInputOption

WithNumberInputMaxValue sets the maximum value.

func WithNumberInputMinValue

func WithNumberInputMinValue(value string) NumberInputOption

WithNumberInputMinValue sets the minimum value.

func WithNumberInputPlaceholder

func WithNumberInputPlaceholder(text string) NumberInputOption

WithNumberInputPlaceholder sets placeholder text. Max 150 characters.

type Option

type Option struct {
	// contains filtered or unexported fields
}

Option represents an option composition object. Used in select menus, checkboxes, radio buttons, and overflow menus.

func NewOption

func NewOption(text, value string, opts ...OptionConfig) (Option, error)

NewOption creates a new Option with plain text. text max: 75 chars, value max: 150 chars

func NewOptionWithMarkdown

func NewOptionWithMarkdown(text, value string, opts ...OptionConfig) (Option, error)

NewOptionWithMarkdown creates an Option with markdown text. Only valid for checkboxes and radio buttons.

func (Option) MarshalJSON

func (o Option) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (Option) Value

func (o Option) Value() string

Value returns the option's value.

type OptionConfig

type OptionConfig func(*Option)

OptionConfig configures an Option.

func WithDescription

func WithDescription(description string) OptionConfig

WithDescription adds a description to the option. Max 75 characters.

func WithMarkdownDescription

func WithMarkdownDescription(description string) OptionConfig

WithMarkdownDescription adds a markdown description (for checkboxes/radio).

func WithOptionURL

func WithOptionURL(url string) OptionConfig

WithOptionURL adds a URL to the option (only for overflow menu). Max 3000 characters.

type OptionGroup

type OptionGroup struct {
	// contains filtered or unexported fields
}

OptionGroup represents an option group composition object. Groups options in select menus.

func NewOptionGroup

func NewOptionGroup(label string, options []Option) (OptionGroup, error)

NewOptionGroup creates a new OptionGroup. label max: 75 chars, options max: 100 items

func (OptionGroup) MarshalJSON

func (g OptionGroup) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type Overflow

type Overflow struct {
	// contains filtered or unexported fields
}

Overflow represents an overflow menu element.

func NewOverflow

func NewOverflow(options []Option, opts ...OverflowOption) (Overflow, error)

NewOverflow creates a new overflow menu. Requires 1-5 options.

func (Overflow) MarshalJSON

func (o Overflow) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type OverflowOption

type OverflowOption func(*Overflow)

OverflowOption configures an Overflow.

func WithOverflowActionID

func WithOverflowActionID(id string) OverflowOption

WithOverflowActionID sets the action_id.

func WithOverflowConfirm

func WithOverflowConfirm(confirm ConfirmDialog) OverflowOption

WithOverflowConfirm adds a confirmation dialog.

type PlainText

type PlainText struct {
	// contains filtered or unexported fields
}

PlainText represents a plain_text composition object.

func MustPlainText

func MustPlainText(text string, opts ...PlainTextOption) PlainText

MustPlainText creates a PlainText or panics on error.

func NewPlainText

func NewPlainText(text string, opts ...PlainTextOption) (PlainText, error)

NewPlainText creates a new PlainText with the given text. By default, emoji rendering is enabled.

func (PlainText) MarshalJSON

func (p PlainText) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (PlainText) Text

func (p PlainText) Text() string

Text returns the text content.

type PlainTextInput

type PlainTextInput struct {
	// contains filtered or unexported fields
}

PlainTextInput allows users to enter freeform text.

func NewPlainTextInput

func NewPlainTextInput(opts ...PlainTextInputOption) PlainTextInput

NewPlainTextInput creates a new plain text input element.

func (PlainTextInput) MarshalJSON

func (p PlainTextInput) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type PlainTextInputOption

type PlainTextInputOption func(*PlainTextInput)

PlainTextInputOption configures a PlainTextInput.

func WithDispatchActionConfig

func WithDispatchActionConfig(config DispatchActionConfig) PlainTextInputOption

WithDispatchActionConfig sets when to dispatch block_actions.

func WithInitialValue

func WithInitialValue(value string) PlainTextInputOption

WithInitialValue sets the initial text value.

func WithMaxLength

func WithMaxLength(max int) PlainTextInputOption

WithMaxLength sets maximum input length.

func WithMinLength

func WithMinLength(min int) PlainTextInputOption

WithMinLength sets minimum input length.

func WithMultiline

func WithMultiline() PlainTextInputOption

WithMultiline enables multiline input.

func WithPlainTextInputActionID

func WithPlainTextInputActionID(id string) PlainTextInputOption

WithPlainTextInputActionID sets the action_id.

func WithPlainTextInputFocusOnLoad

func WithPlainTextInputFocusOnLoad() PlainTextInputOption

WithPlainTextInputFocusOnLoad sets auto-focus.

func WithPlainTextInputPlaceholder

func WithPlainTextInputPlaceholder(text string) PlainTextInputOption

WithPlainTextInputPlaceholder sets placeholder text. Max 150 characters.

type PlainTextOnly

type PlainTextOnly interface {
	TextObject
	// contains filtered or unexported methods
}

PlainTextOnly restricts to plain_text only. Used for headers, placeholders, button text, etc.

type PlainTextOption

type PlainTextOption func(*PlainText)

PlainTextOption configures a PlainText.

func WithEmoji

func WithEmoji(emoji bool) PlainTextOption

WithEmoji sets whether to render emoji codes.

type Plan

type Plan struct {
	// contains filtered or unexported fields
}

Plan displays a collection of related tasks. Available in messages only.

func MustPlan

func MustPlan(title string, sections []PlanSection, opts ...PlanOption) Plan

MustPlan creates a Plan or panics on error.

func NewPlan

func NewPlan(title string, sections []PlanSection, opts ...PlanOption) (Plan, error)

NewPlan creates a new plan block.

func (Plan) MarshalJSON

func (p Plan) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type PlanItem

type PlanItem struct {
	// contains filtered or unexported fields
}

PlanItem represents an item within a plan section.

func MustPlanItem

func MustPlanItem(text string, status PlanItemStatus) PlanItem

MustPlanItem creates a PlanItem or panics on error.

func NewPlanItem

func NewPlanItem(text string, status PlanItemStatus) (PlanItem, error)

NewPlanItem creates a new plan item.

func (PlanItem) MarshalJSON

func (i PlanItem) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type PlanItemStatus

type PlanItemStatus string

PlanItemStatus represents the status of a plan item.

const (
	PlanItemStatusPending    PlanItemStatus = "pending"
	PlanItemStatusInProgress PlanItemStatus = "in_progress"
	PlanItemStatusComplete   PlanItemStatus = "complete"
)

type PlanOption

type PlanOption func(*Plan)

PlanOption configures a Plan block.

func WithPlanBlockID

func WithPlanBlockID(id string) PlanOption

WithPlanBlockID sets the block_id.

type PlanSection

type PlanSection struct {
	// contains filtered or unexported fields
}

PlanSection represents a section within a plan.

func MustPlanSection

func MustPlanSection(title string, items []PlanItem) PlanSection

MustPlanSection creates a PlanSection or panics on error.

func NewPlanSection

func NewPlanSection(title string, items []PlanItem) (PlanSection, error)

NewPlanSection creates a new plan section.

func (PlanSection) MarshalJSON

func (s PlanSection) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type RadioButtons

type RadioButtons struct {
	// contains filtered or unexported fields
}

RadioButtons allows users to choose one item from a list.

func NewRadioButtons

func NewRadioButtons(options []Option, opts ...RadioButtonsOption) (RadioButtons, error)

NewRadioButtons creates a new radio buttons element. Max 10 options.

func (RadioButtons) MarshalJSON

func (r RadioButtons) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type RadioButtonsOption

type RadioButtonsOption func(*RadioButtons)

RadioButtonsOption configures a RadioButtons element.

func WithRadioButtonInitialOption

func WithRadioButtonInitialOption(option Option) RadioButtonsOption

WithRadioButtonInitialOption sets the initially selected option.

func WithRadioButtonsActionID

func WithRadioButtonsActionID(id string) RadioButtonsOption

WithRadioButtonsActionID sets the action_id.

func WithRadioButtonsConfirm

func WithRadioButtonsConfirm(confirm ConfirmDialog) RadioButtonsOption

WithRadioButtonsConfirm adds a confirmation dialog.

func WithRadioButtonsFocusOnLoad

func WithRadioButtonsFocusOnLoad() RadioButtonsOption

WithRadioButtonsFocusOnLoad sets auto-focus.

type RichText

type RichText struct {
	// contains filtered or unexported fields
}

RichText displays formatted, structured representation of text.

func MustRichText

func MustRichText(elements []RichTextElement, opts ...RichTextOption) RichText

MustRichText creates a RichText or panics on error.

func NewRichText

func NewRichText(elements []RichTextElement, opts ...RichTextOption) (RichText, error)

NewRichText creates a new rich text block.

func (RichText) MarshalJSON

func (r RichText) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type RichTextBroadcast

type RichTextBroadcast struct {
	// contains filtered or unexported fields
}

RichTextBroadcast represents a broadcast mention (@channel, @here, @everyone).

func NewRichTextBroadcast

func NewRichTextBroadcast(rang string) RichTextBroadcast

NewRichTextBroadcast creates a new broadcast mention. rang: "channel", "here", or "everyone"

func (RichTextBroadcast) MarshalJSON

func (b RichTextBroadcast) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type RichTextChannel

type RichTextChannel struct {
	// contains filtered or unexported fields
}

RichTextChannel represents a channel mention in a rich text section.

func NewRichTextChannel

func NewRichTextChannel(channelID string, style *RichTextStyle) RichTextChannel

NewRichTextChannel creates a new channel mention for rich text sections.

func (RichTextChannel) MarshalJSON

func (c RichTextChannel) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type RichTextElement

type RichTextElement interface {
	json.Marshaler
	// contains filtered or unexported methods
}

RichTextElement marks elements valid in rich text blocks. Valid types: RichTextSection, RichTextList, RichTextPreformatted, RichTextQuote

type RichTextEmoji

type RichTextEmoji struct {
	// contains filtered or unexported fields
}

RichTextEmoji represents an emoji in a rich text section.

func NewRichTextEmoji

func NewRichTextEmoji(name string) RichTextEmoji

NewRichTextEmoji creates a new emoji element for rich text sections.

func (RichTextEmoji) MarshalJSON

func (e RichTextEmoji) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type RichTextInput

type RichTextInput struct {
	// contains filtered or unexported fields
}

RichTextInput allows users to enter formatted text in a WYSIWYG composer.

func NewRichTextInput

func NewRichTextInput(opts ...RichTextInputOption) RichTextInput

NewRichTextInput creates a new rich text input element.

func (RichTextInput) MarshalJSON

func (r RichTextInput) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type RichTextInputOption

type RichTextInputOption func(*RichTextInput)

RichTextInputOption configures a RichTextInput.

func WithRichTextInputActionID

func WithRichTextInputActionID(id string) RichTextInputOption

WithRichTextInputActionID sets the action_id.

func WithRichTextInputDispatchActionConfig

func WithRichTextInputDispatchActionConfig(config DispatchActionConfig) RichTextInputOption

WithRichTextInputDispatchActionConfig sets when to dispatch block_actions.

func WithRichTextInputFocusOnLoad

func WithRichTextInputFocusOnLoad() RichTextInputOption

WithRichTextInputFocusOnLoad sets auto-focus.

func WithRichTextInputInitialValue

func WithRichTextInputInitialValue(value *RichText) RichTextInputOption

WithRichTextInputInitialValue sets the initial rich text value.

func WithRichTextInputPlaceholder

func WithRichTextInputPlaceholder(text string) RichTextInputOption

WithRichTextInputPlaceholder sets placeholder text. Max 150 characters.

type RichTextLink struct {
	// contains filtered or unexported fields
}

RichTextLink represents a link in a rich text section.

func NewRichTextLink(url string, text string, style *RichTextStyle) RichTextLink

NewRichTextLink creates a new link element for rich text sections.

func (RichTextLink) MarshalJSON

func (l RichTextLink) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type RichTextList

type RichTextList struct {
	// contains filtered or unexported fields
}

RichTextList represents a list in rich text.

func NewRichTextList

func NewRichTextList(style string, elements []RichTextSection, opts ...RichTextListOption) RichTextList

NewRichTextList creates a new rich text list. style: "bullet" or "ordered"

func (RichTextList) MarshalJSON

func (l RichTextList) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type RichTextListOption

type RichTextListOption func(*RichTextList)

RichTextListOption configures a RichTextList.

func WithRichTextListBorder

func WithRichTextListBorder(border int) RichTextListOption

WithRichTextListBorder sets the border (0 or 1).

func WithRichTextListIndent

func WithRichTextListIndent(indent int) RichTextListOption

WithRichTextListIndent sets the indent level (0-8).

func WithRichTextListOffset

func WithRichTextListOffset(offset int) RichTextListOption

WithRichTextListOffset sets the offset for ordered lists.

type RichTextOption

type RichTextOption func(*RichText)

RichTextOption configures a RichText block.

func WithRichTextBlockID

func WithRichTextBlockID(id string) RichTextOption

WithRichTextBlockID sets the block_id.

type RichTextPreformatted

type RichTextPreformatted struct {
	// contains filtered or unexported fields
}

RichTextPreformatted represents preformatted text (code block).

func NewRichTextPreformatted

func NewRichTextPreformatted(elements []RichTextSectionElement, border int) RichTextPreformatted

NewRichTextPreformatted creates a new preformatted text element.

func (RichTextPreformatted) MarshalJSON

func (p RichTextPreformatted) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type RichTextQuote

type RichTextQuote struct {
	// contains filtered or unexported fields
}

RichTextQuote represents a quote in rich text.

func NewRichTextQuote

func NewRichTextQuote(elements []RichTextSectionElement, border int) RichTextQuote

NewRichTextQuote creates a new quote element.

func (RichTextQuote) MarshalJSON

func (q RichTextQuote) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type RichTextSection

type RichTextSection struct {
	// contains filtered or unexported fields
}

RichTextSection represents a section of rich text content.

func NewRichTextSection

func NewRichTextSection(elements []RichTextSectionElement) RichTextSection

NewRichTextSection creates a new rich text section.

func (RichTextSection) MarshalJSON

func (s RichTextSection) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type RichTextSectionElement

type RichTextSectionElement interface {
	json.Marshaler
	// contains filtered or unexported methods
}

RichTextSectionElement is an element within a rich text section.

type RichTextStyle

type RichTextStyle struct {
	Bold   bool `json:"bold,omitempty"`
	Italic bool `json:"italic,omitempty"`
	Strike bool `json:"strike,omitempty"`
	Code   bool `json:"code,omitempty"`
}

RichTextStyle defines text styling options.

func NewRichTextStyle

func NewRichTextStyle(bold, italic, strike, code bool) *RichTextStyle

NewRichTextStyle creates a new style configuration.

type RichTextText

type RichTextText struct {
	// contains filtered or unexported fields
}

RichTextText represents plain or styled text in a rich text section.

func NewRichTextText

func NewRichTextText(text string, style *RichTextStyle) RichTextText

NewRichTextText creates a new text element for rich text sections.

func (RichTextText) MarshalJSON

func (t RichTextText) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type RichTextUser

type RichTextUser struct {
	// contains filtered or unexported fields
}

RichTextUser represents a user mention in a rich text section.

func NewRichTextUser

func NewRichTextUser(userID string, style *RichTextStyle) RichTextUser

NewRichTextUser creates a new user mention for rich text sections.

func (RichTextUser) MarshalJSON

func (u RichTextUser) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type RichTextUserGroup

type RichTextUserGroup struct {
	// contains filtered or unexported fields
}

RichTextUserGroup represents a user group mention in a rich text section.

func NewRichTextUserGroup

func NewRichTextUserGroup(usergroupID string, style *RichTextStyle) RichTextUserGroup

NewRichTextUserGroup creates a new user group mention for rich text sections.

func (RichTextUserGroup) MarshalJSON

func (g RichTextUserGroup) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type Section

type Section struct {
	// contains filtered or unexported fields
}

Section is a flexible block for displaying text and accessories.

func MustSection

func MustSection(text TextObject, opts ...SectionOption) Section

MustSection creates a Section or panics on error.

func NewSection

func NewSection(text TextObject, opts ...SectionOption) (Section, error)

NewSection creates a section with text.

func NewSectionWithFields

func NewSectionWithFields(fields []TextObject, opts ...SectionOption) (Section, error)

NewSectionWithFields creates a section with fields instead of text. Max 10 fields.

func (Section) MarshalJSON

func (s Section) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type SectionAccessory

type SectionAccessory interface {
	json.Marshaler
	// contains filtered or unexported methods
}

SectionAccessory marks elements valid as section block accessories. Valid types: Button, ImageElement, StaticSelect, MultiStaticSelect, ExternalSelect, MultiExternalSelect, UsersSelect, MultiUsersSelect, ConversationsSelect, MultiConversationsSelect, ChannelsSelect, MultiChannelsSelect, DatePicker, TimePicker, Checkboxes, RadioButtons, Overflow

type SectionOption

type SectionOption func(*Section)

SectionOption configures a Section.

func WithSectionAccessory

func WithSectionAccessory(accessory SectionAccessory) SectionOption

WithSectionAccessory adds an accessory element. Type-safety is enforced via the SectionAccessory interface.

func WithSectionBlockID

func WithSectionBlockID(id string) SectionOption

WithSectionBlockID sets the block_id.

func WithSectionFields

func WithSectionFields(fields ...TextObject) SectionOption

WithSectionFields adds fields to the section. Max 10 fields.

type SlackFile

type SlackFile struct {
	// contains filtered or unexported fields
}

SlackFile represents a Slack file composition object. Used in image blocks/elements to reference Slack-hosted files. Either URL or ID must be provided, but not both.

func NewSlackFileFromID

func NewSlackFileFromID(id string) (SlackFile, error)

NewSlackFileFromID creates a SlackFile from a Slack file ID.

func NewSlackFileFromURL

func NewSlackFileFromURL(url string) (SlackFile, error)

NewSlackFileFromURL creates a SlackFile from a URL. The URL can be url_private or permalink of a Slack file.

func (SlackFile) MarshalJSON

func (s SlackFile) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type StaticSelect

type StaticSelect struct {
	// contains filtered or unexported fields
}

StaticSelect allows users to choose one option from a static list.

func NewStaticSelect

func NewStaticSelect(options []Option, opts ...StaticSelectOption) (StaticSelect, error)

NewStaticSelect creates a static select with options. Max 100 options.

func NewStaticSelectWithGroups

func NewStaticSelectWithGroups(groups []OptionGroup, opts ...StaticSelectOption) (StaticSelect, error)

NewStaticSelectWithGroups creates a static select with option groups. Max 100 groups.

func (StaticSelect) MarshalJSON

func (s StaticSelect) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type StaticSelectOption

type StaticSelectOption func(*StaticSelect)

StaticSelectOption configures a StaticSelect.

func WithStaticSelectActionID

func WithStaticSelectActionID(id string) StaticSelectOption

WithStaticSelectActionID sets the action_id.

func WithStaticSelectConfirm

func WithStaticSelectConfirm(confirm ConfirmDialog) StaticSelectOption

WithStaticSelectConfirm adds a confirmation dialog.

func WithStaticSelectFocusOnLoad

func WithStaticSelectFocusOnLoad() StaticSelectOption

WithStaticSelectFocusOnLoad sets auto-focus.

func WithStaticSelectInitialOption

func WithStaticSelectInitialOption(option Option) StaticSelectOption

WithStaticSelectInitialOption sets the initially selected option.

func WithStaticSelectPlaceholder

func WithStaticSelectPlaceholder(text string) StaticSelectOption

WithStaticSelectPlaceholder sets placeholder text.

type Table

type Table struct {
	// contains filtered or unexported fields
}

Table displays structured information in a table format. Available in messages only.

func MustTable

func MustTable(columns []TableColumn, rows []TableRow, opts ...TableOption) Table

MustTable creates a Table or panics on error.

func NewTable

func NewTable(columns []TableColumn, rows []TableRow, opts ...TableOption) (Table, error)

NewTable creates a new table block.

func (Table) MarshalJSON

func (t Table) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type TableCell

type TableCell struct {
	// contains filtered or unexported fields
}

TableCell represents a cell in a table row.

func NewTableCell

func NewTableCell(columnID string, value TableCellValue) TableCell

NewTableCell creates a new table cell.

func (TableCell) MarshalJSON

func (c TableCell) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type TableCellRichText

type TableCellRichText struct {
	// contains filtered or unexported fields
}

TableCellRichText is a rich text value for a table cell.

func NewTableCellRichText

func NewTableCellRichText(elements []RichTextElement) TableCellRichText

NewTableCellRichText creates a new rich text value for a table cell.

func (TableCellRichText) MarshalJSON

func (r TableCellRichText) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type TableCellText

type TableCellText struct {
	// contains filtered or unexported fields
}

TableCellText is a text value for a table cell.

func NewTableCellText

func NewTableCellText(text string) TableCellText

NewTableCellText creates a new text value for a table cell.

func (TableCellText) MarshalJSON

func (t TableCellText) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type TableCellValue

type TableCellValue interface {
	json.Marshaler
	// contains filtered or unexported methods
}

TableCellValue represents the value content of a table cell.

type TableColumn

type TableColumn struct {
	// contains filtered or unexported fields
}

TableColumn defines a column in a table.

func NewTableColumn

func NewTableColumn(id, name string, opts ...TableColumnOption) TableColumn

NewTableColumn creates a new table column.

func (TableColumn) MarshalJSON

func (c TableColumn) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type TableColumnOption

type TableColumnOption func(*TableColumn)

TableColumnOption configures a TableColumn.

func WithTableColumnWidth

func WithTableColumnWidth(width int) TableColumnOption

WithTableColumnWidth sets the column width.

type TableOption

type TableOption func(*Table)

TableOption configures a Table block.

func WithTableBlockID

func WithTableBlockID(id string) TableOption

WithTableBlockID sets the block_id.

type TableRow

type TableRow struct {
	// contains filtered or unexported fields
}

TableRow represents a row in a table.

func NewTableRow

func NewTableRow(cells []TableCell) TableRow

NewTableRow creates a new table row.

func (TableRow) MarshalJSON

func (r TableRow) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type TaskCard

type TaskCard struct {
	// contains filtered or unexported fields
}

TaskCard displays a single task, representing a single action. Available in messages only.

func MustTaskCard

func MustTaskCard(taskID, title string, status TaskCardStatus, opts ...TaskCardOption) TaskCard

MustTaskCard creates a TaskCard or panics on error.

func NewTaskCard

func NewTaskCard(taskID, title string, status TaskCardStatus, opts ...TaskCardOption) (TaskCard, error)

NewTaskCard creates a new task card block.

func (TaskCard) MarshalJSON

func (t TaskCard) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type TaskCardOption

type TaskCardOption func(*TaskCard)

TaskCardOption configures a TaskCard block.

func WithTaskCardBlockID

func WithTaskCardBlockID(id string) TaskCardOption

WithTaskCardBlockID sets the block_id.

func WithTaskCardDescription

func WithTaskCardDescription(text string) TaskCardOption

WithTaskCardDescription sets the description.

func WithTaskCardSources

func WithTaskCardSources(sources []URLSource) TaskCardOption

WithTaskCardSources sets the URL sources.

type TaskCardStatus

type TaskCardStatus string

TaskCardStatus represents the status of a task.

const (
	TaskCardStatusOpen       TaskCardStatus = "open"
	TaskCardStatusInProgress TaskCardStatus = "in_progress"
	TaskCardStatusComplete   TaskCardStatus = "complete"
)

type TextObject

type TextObject interface {
	json.Marshaler
	// contains filtered or unexported methods
}

TextObject represents any text composition object (plain_text or mrkdwn).

type TimePicker

type TimePicker struct {
	// contains filtered or unexported fields
}

TimePicker allows users to select a time.

func NewTimePicker

func NewTimePicker(opts ...TimePickerOption) TimePicker

NewTimePicker creates a new time picker element.

func (TimePicker) MarshalJSON

func (t TimePicker) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type TimePickerOption

type TimePickerOption func(*TimePicker)

TimePickerOption configures a TimePicker.

func WithInitialTime

func WithInitialTime(time string) TimePickerOption

WithInitialTime sets the initially selected time. Format: HH:mm

func WithTimePickerActionID

func WithTimePickerActionID(id string) TimePickerOption

WithTimePickerActionID sets the action_id.

func WithTimePickerConfirm

func WithTimePickerConfirm(confirm ConfirmDialog) TimePickerOption

WithTimePickerConfirm adds a confirmation dialog.

func WithTimePickerFocusOnLoad

func WithTimePickerFocusOnLoad() TimePickerOption

WithTimePickerFocusOnLoad sets auto-focus.

func WithTimePickerPlaceholder

func WithTimePickerPlaceholder(text string) TimePickerOption

WithTimePickerPlaceholder sets placeholder text.

func WithTimezone

func WithTimezone(tz string) TimePickerOption

WithTimezone sets the timezone for the time picker.

type Trigger

type Trigger struct {
	// contains filtered or unexported fields
}

Trigger defines a workflow trigger with URL and optional input parameters.

func MustTrigger

func MustTrigger(url string, opts ...TriggerOption) Trigger

MustTrigger creates a Trigger or panics on error.

func NewTrigger

func NewTrigger(url string, opts ...TriggerOption) (Trigger, error)

NewTrigger creates a new trigger with the given URL.

func (Trigger) MarshalJSON

func (t Trigger) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type TriggerAction

type TriggerAction string

TriggerAction represents when to dispatch a block_actions payload.

const (
	TriggerOnEnterPressed     TriggerAction = "on_enter_pressed"
	TriggerOnCharacterEntered TriggerAction = "on_character_entered"
)

type TriggerOption

type TriggerOption func(*Trigger)

TriggerOption configures a Trigger.

func WithInputParameters

func WithInputParameters(params ...InputParameter) TriggerOption

WithInputParameters sets the customizable input parameters.

type URLInput

type URLInput struct {
	// contains filtered or unexported fields
}

URLInput allows users to enter a URL into a single-line field.

func NewURLInput

func NewURLInput(opts ...URLInputOption) URLInput

NewURLInput creates a new URL input element.

func (URLInput) MarshalJSON

func (u URLInput) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type URLInputOption

type URLInputOption func(*URLInput)

URLInputOption configures a URLInput.

func WithURLInputActionID

func WithURLInputActionID(id string) URLInputOption

WithURLInputActionID sets the action_id.

func WithURLInputDispatchActionConfig

func WithURLInputDispatchActionConfig(config DispatchActionConfig) URLInputOption

WithURLInputDispatchActionConfig sets when to dispatch block_actions.

func WithURLInputFocusOnLoad

func WithURLInputFocusOnLoad() URLInputOption

WithURLInputFocusOnLoad sets auto-focus.

func WithURLInputInitialValue

func WithURLInputInitialValue(value string) URLInputOption

WithURLInputInitialValue sets the initial URL value.

func WithURLInputPlaceholder

func WithURLInputPlaceholder(text string) URLInputOption

WithURLInputPlaceholder sets placeholder text. Max 150 characters.

type URLSource

type URLSource struct {
	// contains filtered or unexported fields
}

URLSource represents a URL source for referencing within a task card.

func MustURLSource

func MustURLSource(url string, opts ...URLSourceOption) URLSource

MustURLSource creates a URLSource or panics on error.

func NewURLSource

func NewURLSource(url string, opts ...URLSourceOption) (URLSource, error)

NewURLSource creates a new URL source element.

func (URLSource) MarshalJSON

func (s URLSource) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type URLSourceOption

type URLSourceOption func(*URLSource)

URLSourceOption configures a URLSource.

func WithURLSourceTitle

func WithURLSourceTitle(title string) URLSourceOption

WithURLSourceTitle sets the title for the URL source.

type UsersSelect

type UsersSelect struct {
	// contains filtered or unexported fields
}

UsersSelect allows users to select a user from the workspace.

func NewUsersSelect

func NewUsersSelect(opts ...UsersSelectOption) UsersSelect

NewUsersSelect creates a user select element.

func (UsersSelect) MarshalJSON

func (u UsersSelect) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type UsersSelectOption

type UsersSelectOption func(*UsersSelect)

UsersSelectOption configures a UsersSelect.

func WithInitialUser

func WithInitialUser(userID string) UsersSelectOption

WithInitialUser sets the initially selected user ID.

func WithUsersSelectActionID

func WithUsersSelectActionID(id string) UsersSelectOption

WithUsersSelectActionID sets the action_id.

func WithUsersSelectConfirm

func WithUsersSelectConfirm(confirm ConfirmDialog) UsersSelectOption

WithUsersSelectConfirm adds a confirmation dialog.

func WithUsersSelectFocusOnLoad

func WithUsersSelectFocusOnLoad() UsersSelectOption

WithUsersSelectFocusOnLoad sets auto-focus.

func WithUsersSelectPlaceholder

func WithUsersSelectPlaceholder(text string) UsersSelectOption

WithUsersSelectPlaceholder sets placeholder text.

type ValidationError

type ValidationError struct {
	Field   string
	Value   any
	Message string
	Cause   error
}

ValidationError represents a validation failure with context.

func (ValidationError) Error

func (e ValidationError) Error() string

func (ValidationError) Unwrap

func (e ValidationError) Unwrap() error

type Video

type Video struct {
	// contains filtered or unexported fields
}

Video displays an embedded video player.

func MustVideo

func MustVideo(altText, title, thumbnailURL, videoURL string, opts ...VideoOption) Video

MustVideo creates a Video or panics on error.

func NewVideo

func NewVideo(altText, title, thumbnailURL, videoURL string, opts ...VideoOption) (Video, error)

NewVideo creates a new video block. altText: max 2000 characters title: max 200 characters

func (Video) MarshalJSON

func (v Video) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type VideoOption

type VideoOption func(*Video)

VideoOption configures a Video block.

func WithVideoAuthorName

func WithVideoAuthorName(name string) VideoOption

WithVideoAuthorName sets the author name.

func WithVideoBlockID

func WithVideoBlockID(id string) VideoOption

WithVideoBlockID sets the block_id.

func WithVideoDescription

func WithVideoDescription(text string) VideoOption

WithVideoDescription sets the description.

func WithVideoProviderIconURL

func WithVideoProviderIconURL(url string) VideoOption

WithVideoProviderIconURL sets the provider icon URL.

func WithVideoProviderName

func WithVideoProviderName(name string) VideoOption

WithVideoProviderName sets the provider name.

func WithVideoTitleURL

func WithVideoTitleURL(url string) VideoOption

WithVideoTitleURL sets the title URL (clickable link).

type Workflow

type Workflow struct {
	// contains filtered or unexported fields
}

Workflow defines a workflow object containing trigger information.

func NewWorkflow

func NewWorkflow(trigger Trigger) Workflow

NewWorkflow creates a new workflow with the given trigger.

func (Workflow) MarshalJSON

func (w Workflow) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type WorkflowButton

type WorkflowButton struct {
	// contains filtered or unexported fields
}

WorkflowButton allows users to run a link trigger with customizable inputs.

func MustWorkflowButton

func MustWorkflowButton(text string, workflow Workflow, opts ...WorkflowButtonOption) WorkflowButton

MustWorkflowButton creates a WorkflowButton or panics on error.

func NewWorkflowButton

func NewWorkflowButton(text string, workflow Workflow, opts ...WorkflowButtonOption) (WorkflowButton, error)

NewWorkflowButton creates a new workflow button element. text max: 75 characters

func (WorkflowButton) MarshalJSON

func (w WorkflowButton) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type WorkflowButtonOption

type WorkflowButtonOption func(*WorkflowButton)

WorkflowButtonOption configures a WorkflowButton.

func WithWorkflowButtonAccessibilityLabel

func WithWorkflowButtonAccessibilityLabel(label string) WorkflowButtonOption

WithWorkflowButtonAccessibilityLabel sets the accessibility label. Max 75 characters.

func WithWorkflowButtonActionID

func WithWorkflowButtonActionID(id string) WorkflowButtonOption

WithWorkflowButtonActionID sets the action_id.

func WithWorkflowButtonStyle

func WithWorkflowButtonStyle(style ButtonStyle) WorkflowButtonOption

WithWorkflowButtonStyle sets the button style (primary or danger).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL