Slack Carousel Block (block_carousel.go)

slack · block_carousel.go · go · BSD-2-Clause
integration, chat, ui, lang:go, tag:block-kit

Defines a scrollable Slack Block Kit carousel element containing multiple cards. Reuse when building interactive Slack messaging UIs.

// Source: https://github.com/slack-go/slack | License: BSD-2-Clause | Copyright 2015, Norberto Lopes
// Provided via justclaw.it.com; keep this notice with the code.
package slack

// CarouselBlock defines a block of type carousel that displays a scrollable
// list of cards. A carousel must contain between 1 and 10 cards.
//
// More Information: https://docs.slack.dev/reference/block-kit/blocks/carousel-block/
type CarouselBlock struct {
	Type     MessageBlockType `json:"type"`
	BlockID  string           `json:"block_id,omitempty"`
	Elements []*CardBlock     `json:"elements"`
}

// BlockType returns the type of the block
func (s CarouselBlock) BlockType() MessageBlockType {
	return s.Type
}

// ID returns the ID of the block
func (s CarouselBlock) ID() string {
	return s.BlockID
}

// New

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key