Skip to main content

@slack/types / CardBlock

Interface: CardBlock

Defined in: block-kit/blocks.ts:207

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: block-kit/blocks.ts:238

Description​

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


block_id?​

optional block_id?: string;

Defined in: block-kit/blocks.ts:50

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: block-kit/blocks.ts:234

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: block-kit/blocks.ts:215

Description​

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


icon?​

optional icon?: ImageElement;

Defined in: block-kit/blocks.ts:219

Description​

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


subtitle?​

optional subtitle?: MrkdwnElement;

Defined in: block-kit/blocks.ts:229

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: block-kit/blocks.ts:224

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: block-kit/blocks.ts:211

Description​

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

Overrides​

Block.type