Slackblocks.Blocks.Card (slackblocks v2.8.0)
View SourceA compact card with an image, text, and up to three buttons.
Slack reference: https://docs.slack.dev/reference/block-kit/blocks/card-block
Fields
hero_image— Sets the image displayed prominently at the top of the card. Optional;nilomits the field.icon— Sets the image displayed beside the title. Optional;nilomits the field.title— Sets the card title. Optional;nilomits the field.subtitle— Sets the supporting text shown below the title. Optional;nilomits the field.body— Sets the main body text of the card. Optional;nilomits the field.actions— Adds buttons displayed at the bottom of the card, in display order. Optional;nilomits the field.slack_icon— Sets a Slack-provided icon displayed beside the title. Cannot be combined with an image icon. Optional;nilomits the field.subtext— Sets the small print shown at the bottom of the card. Optional;nilomits the field.block_id— Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again. Optional;nilomits the field.
Summary
Functions
Atomically replaces supplied fields; omitted fields retain their values.
Replaces fields or raises Slackblocks.ValidationError.
Constructs and validates a value. Text conveniences apply to keyword input.
Constructs a value or raises Slackblocks.ValidationError.
Types
@type t() :: %Slackblocks.Blocks.Card{ actions: [Slackblocks.Elements.Button.t()] | nil, block_id: binary() | nil, body: Slackblocks.Types.text() | nil, hero_image: Slackblocks.Elements.Image.t() | nil, icon: Slackblocks.Elements.Image.t() | nil, slack_icon: Slackblocks.Objects.SlackIcon.t() | nil, subtext: Slackblocks.Types.text() | nil, subtitle: Slackblocks.Types.text() | nil, title: Slackblocks.Types.text() | nil }
Functions
@spec change( t(), keyword() ) :: {:ok, t()} | {:error, Slackblocks.ValidationError.t()}
Atomically replaces supplied fields; omitted fields retain their values.
Replaces fields or raises Slackblocks.ValidationError.
@spec new(keyword()) :: {:ok, t()} | {:error, Slackblocks.ValidationError.t()}
Constructs and validates a value. Text conveniences apply to keyword input.
Constructs a value or raises Slackblocks.ValidationError.