Skip to main content
Card components provide a cross-platform way to create rich, interactive messages. They automatically convert to:
  • Slack: Block Kit
  • Teams: Adaptive Cards
  • Google Chat: Card v2

Usage

Cards support both function calls and JSX syntax.

Function API

JSX API

Requires jsxImportSource: "chat" in tsconfig.json.

Card

Root container for card content.
string
Card title (displayed as header)
string
Card subtitle (displayed below title)
string
Header image URL
CardChild[]
Card content elements

CardOptions Type

Text

Text content element.
string
required
Text content (supports markdown on some platforms)
'plain' | 'bold' | 'muted'
Text style
Example:

Image

Image element.
string
required
Image URL
string
Alt text for accessibility
Example:

Divider

Visual divider/separator.
Example:

Section

Container for grouping elements.
Example:

Actions

Container for buttons and selects.
Example:

Button

Interactive button that triggers an action.
string
required
Unique action ID for callback routing
string
required
Button label text
'primary' | 'danger' | 'default'
Visual style
string
Optional payload value sent with action callback
boolean
If true, button is displayed inactive and doesn’t respond to clicks
Example:

LinkButton

Button that opens a URL when clicked.
string
required
URL to open when clicked
string
required
Button label text
'primary' | 'danger' | 'default'
Visual style
Example:

Field

Key-value pair for displaying structured data.
string
required
Field label
string
required
Field value
Example:

Fields

Container for multi-column field layout.
Example:

Table

Structured data table.
string[]
required
Column header labels
string[][]
required
Data rows (each row is an array of cell strings)
('left' | 'center' | 'right')[]
Column alignment
Example:
Inline hyperlink element.
string
required
URL to link to
string
required
Link label text
Example:

Complete Example

Type Definitions