Skip to content

Rich content & cards

Rich content is produced by the bot (via its tools/persona), not authored by your app. Your job is mostly to (a) let the bot know what it can do, and (b) handle taps. The exact shapes are in the Rich content schema and Rich actions.

A card

{
"type": "rich_content",
"components": [{
"type": "card",
"id": "look_42",
"title": "Strawberry Girl",
"subtitle": "Romantic rose",
"image": { "url": "https://…/look.jpg", "aspect_ratio": "1:1" },
"actions": [
{ "type": "callback", "callback_id": "open_design", "payload": { "design": { "id": 42 } } }
]
}]
}

Tapping ”…” fires a callback your app handles — see Host callbacks & actions.

Carousels

Wrap cards in a carousel. The SDK snaps between full-width cards with page indicators and a peek of the next card. Height adapts to the card content (image aspect ratio + text), capped so one card can’t dominate the screen.

A card carousel rendered natively in the chat, with page indicators and a peek of the next card

Async / slow tools

For a tool that takes a while (e.g. image generation), the bot can return a card with image.loading: true and an empty URL — the SDK shows a shimmer. Your host polls the task and swaps in the final URL when it’s ready.

Standalone images & galleries

An image component renders full-width with an optional caption; tapping opens a zoomable viewer (or fires on_tap_callback if you’d rather handle it natively).