Card block
Fields
| Field | Type | Description | Required? |
|---|---|---|---|
type | String | The type of block. For a card block, type is always card. | Required |
block_id | String | A unique identifier for a block. If not specified, a block_id will be generated. | Optional |
hero_image | String | Link to the top image used on the card. | Optional |
icon | String | Link to the small image used next to the card's title and subtitle. | Optional |
title | String | Title of the card. 150 characters max. | Optional |
subtitle | String | Subtitle of the card. 150 characters max. | Optional |
body | String | Content of the card. 200 characters max. | Optional |
actions | String | Action buttons shown at the bottom of the card. | Optional |
At least one of hero_image, title, actions, or body is required.
Note that there is not currently an attribute to define the size of the card.
Example
A sample card block:
- JSON
{
"blocks": [
{
"type": "card",
"icon": {
"type": "image",
"image_url": "https://picsum.photos/36/36",
"alt_text": "Icon"
},
"title": {
"type": "mrkdwn",
"text": "Lumon Industries",
"verbatim": false
},
"subtitle": {
"type": "mrkdwn",
"text": "Committed to work-life balance",
"verbatim": false
},
"hero_image": {
"type": "image",
"image_url": "https://picsum.photos/400/300",
"alt_text": "Sample hero image"
},
"body": {
"type": "mrkdwn",
"text": "Please enjoy each card equally.",
"verbatim": false
},
"actions": [
{
"type": "button",
"text": {
"type": "plain_text",
"text": "Action Button",
"emoji": false
},
"action_id": "button_action"
}
]
}
]
}