|
| 1 | +[@slack/types](../index.md) / CardBlock |
| 2 | + |
| 3 | +# Interface: CardBlock |
| 4 | + |
| 5 | +Defined in: [block-kit/blocks.ts:139](https://github.com/slackapi/node-slack-sdk/blob/main/packages/types/src/block-kit/blocks.ts#L139) |
| 6 | + |
| 7 | +## Description |
| 8 | + |
| 9 | +A rich display block for presenting structured content such as recommendations, results, or work items. |
| 10 | +At least one of `hero_image`, `title`, `actions`, or `body` must be provided. |
| 11 | + |
| 12 | +## See |
| 13 | + |
| 14 | +[Card block reference](https://docs.slack.dev/reference/block-kit/blocks/card-block). |
| 15 | + |
| 16 | +## Extends |
| 17 | + |
| 18 | +- [`Block`](Block.md) |
| 19 | + |
| 20 | +## Properties |
| 21 | + |
| 22 | +### actions? |
| 23 | + |
| 24 | +```ts |
| 25 | +optional actions: Button[]; |
| 26 | +``` |
| 27 | + |
| 28 | +Defined in: [block-kit/blocks.ts:170](https://github.com/slackapi/node-slack-sdk/blob/main/packages/types/src/block-kit/blocks.ts#L170) |
| 29 | + |
| 30 | +#### Description |
| 31 | + |
| 32 | +An array of [Button](Button.md) elements displayed at the bottom of the card. |
| 33 | + |
| 34 | +*** |
| 35 | + |
| 36 | +### block\_id? |
| 37 | + |
| 38 | +```ts |
| 39 | +optional block_id: string; |
| 40 | +``` |
| 41 | + |
| 42 | +Defined in: [block-kit/blocks.ts:49](https://github.com/slackapi/node-slack-sdk/blob/main/packages/types/src/block-kit/blocks.ts#L49) |
| 43 | + |
| 44 | +#### Description |
| 45 | + |
| 46 | +A string acting as a unique identifier for a block. If not specified, a `block_id` will be generated. |
| 47 | +You can use this `block_id` when you receive an interaction payload to |
| 48 | +[identify the source of the action](https://docs.slack.dev/interactivity/handling-user-interaction#payloads). |
| 49 | +Maximum length for this field is 255 characters. `block_id` should be unique for each message and each iteration of |
| 50 | +a message. If a message is updated, use a new `block_id`. |
| 51 | + |
| 52 | +#### Inherited from |
| 53 | + |
| 54 | +[`Block`](Block.md).[`block_id`](Block.md#block_id) |
| 55 | + |
| 56 | +*** |
| 57 | + |
| 58 | +### body? |
| 59 | + |
| 60 | +```ts |
| 61 | +optional body: MrkdwnElement; |
| 62 | +``` |
| 63 | + |
| 64 | +Defined in: [block-kit/blocks.ts:166](https://github.com/slackapi/node-slack-sdk/blob/main/packages/types/src/block-kit/blocks.ts#L166) |
| 65 | + |
| 66 | +#### Description |
| 67 | + |
| 68 | +The body text of the card in the form of a [MrkdwnElement](MrkdwnElement.md). |
| 69 | +Maximum length for the text in this field is 200 characters. |
| 70 | + |
| 71 | +*** |
| 72 | + |
| 73 | +### hero\_image? |
| 74 | + |
| 75 | +```ts |
| 76 | +optional hero_image: ImageElement; |
| 77 | +``` |
| 78 | + |
| 79 | +Defined in: [block-kit/blocks.ts:147](https://github.com/slackapi/node-slack-sdk/blob/main/packages/types/src/block-kit/blocks.ts#L147) |
| 80 | + |
| 81 | +#### Description |
| 82 | + |
| 83 | +A top banner image for the card in the form of an [ImageElement](../type-aliases/ImageElement.md). |
| 84 | + |
| 85 | +*** |
| 86 | + |
| 87 | +### icon? |
| 88 | + |
| 89 | +```ts |
| 90 | +optional icon: ImageElement; |
| 91 | +``` |
| 92 | + |
| 93 | +Defined in: [block-kit/blocks.ts:151](https://github.com/slackapi/node-slack-sdk/blob/main/packages/types/src/block-kit/blocks.ts#L151) |
| 94 | + |
| 95 | +#### Description |
| 96 | + |
| 97 | +A small icon displayed next to the title and subtitle in the form of an [ImageElement](../type-aliases/ImageElement.md). |
| 98 | + |
| 99 | +*** |
| 100 | + |
| 101 | +### subtitle? |
| 102 | + |
| 103 | +```ts |
| 104 | +optional subtitle: MrkdwnElement; |
| 105 | +``` |
| 106 | + |
| 107 | +Defined in: [block-kit/blocks.ts:161](https://github.com/slackapi/node-slack-sdk/blob/main/packages/types/src/block-kit/blocks.ts#L161) |
| 108 | + |
| 109 | +#### Description |
| 110 | + |
| 111 | +The subtitle of the card in the form of a [MrkdwnElement](MrkdwnElement.md). |
| 112 | +Maximum length for the text in this field is 150 characters. |
| 113 | + |
| 114 | +*** |
| 115 | + |
| 116 | +### title? |
| 117 | + |
| 118 | +```ts |
| 119 | +optional title: MrkdwnElement; |
| 120 | +``` |
| 121 | + |
| 122 | +Defined in: [block-kit/blocks.ts:156](https://github.com/slackapi/node-slack-sdk/blob/main/packages/types/src/block-kit/blocks.ts#L156) |
| 123 | + |
| 124 | +#### Description |
| 125 | + |
| 126 | +The title of the card in the form of a [MrkdwnElement](MrkdwnElement.md). |
| 127 | +Maximum length for the text in this field is 150 characters. |
| 128 | + |
| 129 | +*** |
| 130 | + |
| 131 | +### type |
| 132 | + |
| 133 | +```ts |
| 134 | +type: "card"; |
| 135 | +``` |
| 136 | + |
| 137 | +Defined in: [block-kit/blocks.ts:143](https://github.com/slackapi/node-slack-sdk/blob/main/packages/types/src/block-kit/blocks.ts#L143) |
| 138 | + |
| 139 | +#### Description |
| 140 | + |
| 141 | +The type of block. For a card block, `type` is always `card`. |
| 142 | + |
| 143 | +#### Overrides |
| 144 | + |
| 145 | +[`Block`](Block.md).[`type`](Block.md#type) |
0 commit comments