Skip to content
Block Kit for React
Esc
↑↓navigate↵open⌘Jpreview
On this page

Card

A bordered card with an icon, title, subtitle, hero image, body text, and actions.

card lays out a small piece of content (an icon or image, a title and subtitle, a hero image, body text, and buttons) inside a bordered box. It’s a library-invented block, not part of the public @slack/types package; use it standalone or as an item inside a carousel.

Your AppAPP
Sample hero image
Icon
Sample Card Title
This is a subtitle
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
onActionInteract with the preview.

Fields

PropType
typestring

Always `card`.

Typestring
icon?{ type: "image"; image_url: string; alt_text?: string }

A 36×36 rounded icon, left of the title and subtitle. Takes precedence over `slack_icon`.

Type{ type: "image"; image_url: string; alt_text?: string }
slack_icon?{ type: "icon"; name: string }

One of Slack's icon-font glyphs. This library can't render the icon font, so it shows a neutral badge with the icon's name in a tooltip instead.

Type{ type: "icon"; name: string }
title?PlainTextElement | MrkdwnElement

The card's bold title.

TypePlainTextElement | MrkdwnElement
subtitle?PlainTextElement | MrkdwnElement

Muted text under the title.

TypePlainTextElement | MrkdwnElement
hero_image?{ type: "image"; image_url: string; alt_text?: string }

A full-width image above the header.

Type{ type: "image"; image_url: string; alt_text?: string }
body?PlainTextElement | MrkdwnElement

The card's main text.

TypePlainTextElement | MrkdwnElement
subtext?PlainTextElement | MrkdwnElement

Fine print below the body.

TypePlainTextElement | MrkdwnElement
actions?Element[]

Buttons and other interactive elements, rendered along the bottom of the card.

TypeElement[]

Examples

With and without a hero image

Your AppAPP
Sample hero image
Icon
Sample Card Title
This is a subtitle
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Your AppAPP
Icon
Sample Card Title
This is a subtitle
Lorem ipsum dolor sit amet, consectetur adipiscing elit.

With and without an icon

Your AppAPP
Icon
Sample Card Title
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Your AppAPP
Sample Card Title
This is a subtitle
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Your AppAPP
Sample hero image
Sample Card Title
This is a subtitle
Lorem ipsum dolor sit amet, consectetur adipiscing elit.

With and without a subtitle

Your AppAPP
Icon
Sample Card Title
Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Dropping subtitle centers a lone title on the icon instead of stacking the two.

Subtext and multiple actions

Your AppAPP
Sample Card Title
This is a subtitle
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
This is subtext that appears below the body
onActionInteract with the preview.

A danger-styled button is always grouped to the left; every other button keeps its original order on the right, regardless of where it appears in actions.

Interactivity

Each entry in actions is a standard interactive element, most often a button, and dispatches Slack’s block_actions payload the same way an actions block does. Click a button in any preview above and check the action log: onAction receives

{
  "type": "button",
  "action_id": "button_action",
  "block_id": "<the card's block_id>",
  "text": { "type": "plain_text", "text": "Action Button", "emoji": false },
  "value": "…"
}

alongside the full block_actions payload your app’s request URL would receive.

Was this page helpful?