Cards
Cards are structured, interactive messages that each adapter renders in its platform's native format: Block Kit on Slack, Adaptive Cards on Teams, embeds or Components on Discord, and Cards on Google Chat.
Setup
Configure your tsconfig.json to use the Chat SDK JSX runtime:
Or use a per-file pragma:
Basic card
Components
Card
The top-level container. Accepts title and optional subtitle.
Set width="full" to ask for a wider card on platforms that can render one. Teams renders it as a full-width Adaptive Card; other adapters ignore the hint.
CardText
Renders formatted text. Supports a subset of markdown.
Use CardText instead of Text when using JSX to avoid conflicts with React's built-in types.
Section
Groups related content together.
Fields
Renders key-value pairs in a compact layout.
Button
An action button that triggers an onAction handler.
The id maps to your onAction handler. Optional value passes extra data:
Set actionType="modal" to indicate the button opens a modal. The button still triggers your onAction handler, where you call event.openModal(). The prop tells adapters such as Teams to wire the button up to open a dialog:
Optional callbackUrl causes the action data to be POSTed to a URL when clicked. See Callback URLs for details.
Optional tooltip is hover text for the button. Teams renders it; other adapters ignore it:
Optional visibleTo lists the user IDs that can see the button. Slack renders it with visible_to_user_ids, and everyone else in the conversation won't see the button. Other adapters ignore it and show the button to everyone:
visibleTo only controls who sees the button. It doesn't stop other users from triggering the action, so check event.user in your onAction handler before you act on it.
CardLink
Inline hyperlink rendered as text. LinkButton must be inside Actions, but you can place CardLink directly in a card alongside other content.
Or with children as the label:
CardLink renders as a platform-native link: <url|label> on Slack, [label](url) on Teams/Discord/GitHub/Linear, and <a href> on Google Chat.
LinkButton
Opens an external URL. No onAction handler needed for navigation. On platforms
that emit link-button click events, such as Slack, pass id when you need a
stable action identifier for routing or analytics.
Optional tooltip is hover text for the button. Teams renders it; other adapters ignore it:
LinkButton also accepts visibleTo, which works the same way as on Button.
Actions
Container for buttons and interactive elements.
Select
Inline dropdown menu.
Selection triggers an onAction handler with the id as the actionId and the selected value.
RadioSelect
Radio button group for mutually exclusive choices.
TextInput
A text box on the card itself, so a user can type a reply without opening a modal. Only Teams renders it. Slack, Google Chat, Discord, GitHub, and Linear show the label as text. WhatsApp, Messenger, Twilio, and X omit the input, so don't make it the only content on the card.
What the user typed arrives on the action as event.values, keyed by input ID. Teams validates every input on the card before it lets a button through, so mark an input optional unless the buttons beside it should stay blocked until it is filled. A button that opens a modal isn't blocked. On Teams, actionId, value, and msteams are reserved and can't be used as a card input's ID. The Teams client enforces that validation, so treat event.values as user input and validate it in the handler too. Pair the input with a Button, because the input can't submit anything on its own.
Table
Structured data display with column headers and rows. Renders as a native table on platforms that support it (Slack, Teams, GitHub, Linear), as GFM markdown in Discord card payloads, and as padded ASCII text elsewhere.
Optional column alignment:
On Teams, tables render as the native Adaptive Card Table element: grid lines between cells, columns sized by relative weight and a header row marked for accessibility. The optional widths, verticalAlign, gridLines and gridStyle props tune that rendering and are ignored on other platforms:
Pass gridLines={false} for a borderless table. A table with empty headers renders without a header row.
On Slack, tables render as paginated, sortable data tables. The optional caption (accessible table description) and pageSize (rows per page, 1–100) props tune that rendering and are ignored on other platforms:
Chart
Data visualization with pie, bar, area, and line charts. Renders as a native data visualization on Slack; other platforms fall back to the chart's data rendered as a text table.
Bar, area, and line charts take named series plotted against shared categories:
Slack enforces a 50-character title, up to 12 segments or series, up to 20 categories, 20-character labels, and at most 2 charts per message. Charts that exceed these limits fall back to a text rendering of the data instead of being rejected by the API.
Image
Embeds an image in the card.
Divider
A visual separator between sections.
Full example
Read more
Actions
Handle button clicks and interactive card events across platforms.
Modals
Collect structured user input through modal dialogs with text fields, dropdowns, and validation.
Cards
Rich card components for cross-platform interactive messages.
Emoji
Type-safe, cross-platform emoji that convert to each platform's format.