Cards and UI Components
The Chat SDK provides a unified API for creating rich cards that automatically convert to platform-specific formats:- Slack: Block Kit
- Microsoft Teams: Adaptive Cards
- Google Chat: Card v2
JSX Syntax
To use JSX, configure yourtsconfig.json:
tsconfig.json
Function API
Prefer function calls? Same result:Available Components
Card
The root container for all card content.Text
Display text content with optional styling.Use
CardText instead of Text if you need to avoid conflicts with the global DOM Text constructor.Image
Embed images in your cards.Divider
A visual separator between sections.Section
Group related content together.Fields
Display key-value pairs in a multi-column layout.Table
Display structured data in a table format.Link
Inline hyperlink element.Complete Example
Here’s a comprehensive card showcasing multiple components:Fallback Text
Cards automatically generate plain text fallbacks for platforms or clients that can’t render rich cards:React Integration
If you’re using React components, convert them to card elements:Next Steps
Actions
Add interactive buttons and handle clicks
Modals
Create forms and dialog workflows