Skip to main content

@slack/web-api / CardBlock

Interface: CardBlock

Defined in: packages/types/dist/block-kit/blocks.d.ts:133

Description​

Displays content in a card. At least one of hero_image, title, actions, or body must be provided.

See​

Card block reference.

Extends​

Properties​

actions?​

optional actions?: Button[];

Defined in: packages/types/dist/block-kit/blocks.d.ts:164

Description​

An array of Button elements displayed at the bottom of the card.


block_id?​

optional block_id?: string;

Defined in: packages/types/dist/block-kit/blocks.d.ts:15

Description​

A string acting as a unique identifier for a block. If not specified, a block_id will be generated. You can use this block_id when you receive an interaction payload to identify the source of the action. Maximum length for this field is 255 characters. block_id should be unique for each message and each iteration of a message. If a message is updated, use a new block_id.

Inherited from​

Block.block_id


body?​

optional body?: MrkdwnElement;

Defined in: packages/types/dist/block-kit/blocks.d.ts:160

Description​

The body text of the card in the form of a MrkdwnElement. Maximum length for the text in this field is 200 characters.


hero_image?​

optional hero_image?: ImageElement;

Defined in: packages/types/dist/block-kit/blocks.d.ts:141

Description​

A top banner image for the card in the form of an ImageElement.


icon?​

optional icon?: ImageElement;

Defined in: packages/types/dist/block-kit/blocks.d.ts:145

Description​

A small icon displayed next to the title and subtitle in the form of an ImageElement.


subtitle?​

optional subtitle?: MrkdwnElement;

Defined in: packages/types/dist/block-kit/blocks.d.ts:155

Description​

The subtitle of the card in the form of a MrkdwnElement. Maximum length for the text in this field is 150 characters.


title?​

optional title?: MrkdwnElement;

Defined in: packages/types/dist/block-kit/blocks.d.ts:150

Description​

The title of the card in the form of a MrkdwnElement. Maximum length for the text in this field is 150 characters.


type​

type: "card";

Defined in: packages/types/dist/block-kit/blocks.d.ts:137

Description​

The type of block. For a card block, type is always card.

Overrides​

Block.type