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, using plain_text or mrkdwn formatting. 150 characters max. | Optional |
subtitle | String | Subtitle of the card, using plain_text or mrkdwn formatting. 150 characters max. | Optional |
body | String | Content of the card, using plain_text or mrkdwn formatting. 200 characters max. | Optional |
actions | String | Action buttons shown at the bottom of the card, maximum of 3 buttons. Buttons with danger style will be left-aligned, while buttons with primary or no style will be right-aligned (buttons with primary style will be furthest to the right). | Optional |
slack_icon | Slack icon composition object | A Slack icon to be rendered next to the card's title and subtitle. Mutually exclusive with icon, that is, only one of icon & slack_icon can be present as they render in the same location on the card. | Optional |
subtext | String | Subtext to be rendered below body of the card, using plain_text or mrkdwn formatting. Maximum 200 characters. | 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"
}
]
}
]
}