> ## Documentation Index
> Fetch the complete documentation index at: https://docs.heylua.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Response formatting

> How ::: blocks in a reply become cards, buttons, carousels, files, and reactions, which blocks the model already knows, and where each one renders

A formatting component is a block in the agent's reply text that starts with `::: <name>` and ends with `:::`. The model writes the block as plain text; each [channel](https://docs.heylua.ai/concepts/channels.md) then turns it into what that channel can show: cards in the web widget, an interactive list on WhatsApp, an Adaptive Card in Teams, an attachment in email. Components exist so one agent can answer every channel from one persona and one set of skills without your code knowing where a reply is displayed.

## From reply text to rendered message

The reply is ordinary Markdown with blocks embedded in it:

```text theme={null}
Here are two rooms for those dates.

::: list-item
![image](https://cdn.example.com/deluxe.jpg)
# Deluxe Ocean View
## $250 per night · 3 left
King bed, private balcony, breakfast included.
:::

::: actions
- Book the Deluxe Ocean View
- Show me cheaper rooms
:::
```

Before delivery, a messaging channel extracts every block it knows, sends each in its native form, and sends the remaining text as the message body. The same extraction runs for replies in a conversation and for messages you send with [`Channels.send`](https://docs.heylua.ai/build/send-proactive-messages) to WhatsApp, Messenger, Instagram, and MessageBird. The web widget parses blocks in the browser and renders them while the reply streams. A channel that can't render a block drops it or sends it as text; the matrix under Rendering by channel says which. The rules every surface uses to find a block, including the spellings that also count, are on [Block syntax](https://docs.heylua.ai/channels/formatting/syntax.md).

## Taught blocks and instructed blocks

On every text channel the platform prompt teaches the model the syntax for `list-item`, `horizontal-list-item`, `actions`, `links`, `images`, and `payment`; on every channel except `web` it also teaches `flow` (WhatsApp only) and `reaction`. The model decides when to use them, so for predictable output say when and how in the [persona](https://docs.heylua.ai/concepts/persona.md) or a [skill's context](https://docs.heylua.ai/build/write-skill-context.md). `form` is taught only to chat apps that declare the `forms-v1` capability (see [`form`](https://docs.heylua.ai/channels/formatting/form)). `documents` is taught only on channels that show it (the web widget, the desktop and dashboard chat, mobile, WhatsApp, Teams, RCS, iMessage, MessageBird, Slack), for a file whose link a tool returned or the conversation contains; `navigate` is never taught. Elsewhere both appear only when your instructions include their syntax.

Two cases change the rules. On the `web` channel (Lua Desktop and the admin dashboard's chat) the model is told to prefer plain Markdown, to use cards only for options the end user picks from, and never to emit `flow`; the web widget is not on that channel (it reports `pop`) and gets the same rulebook as the messaging channels. A client that declares the `plain-markdown` capability gets plain Markdown and no blocks at all: `lua chat` declares it, and the [HTTP chat API](https://docs.heylua.ai/reference/rest/chat.md) accepts it as `clientCapabilities: ["plain-markdown"]`. Voice turns get no blocks either; the same data goes through tools that show it on screen.

## Rendered previews before release

Nothing shows a sandbox version with its blocks rendered. `lua chat` declares `plain-markdown` in both environments, so it prints Markdown and never a card, and `lua chat --agent-version` runs against production. Two clients render blocks, and both talk to the agent's production version: the web widget, and the chat panel in the admin dashboard's agent workspace, which is on the `web` channel and so gets the plain-Markdown-first rulebook; a block your instructions ask for still renders there. To see a reply on a real messaging app, [test on Lua's channels](https://docs.heylua.ai/channels/quick-testing.md) over WhatsApp, Messenger, Instagram, or Slack, which also deliver production. The HTTP chat API returns blocks as raw markers for your own client to render.

## Rendering by channel

Three terms recur in the matrix. The messaging channels are WhatsApp, Messenger, Instagram, Slack, Teams, RCS, MessageBird, and iMessage; they share one extractor. Email has two forms: a generated inbox is the address Lua issues, and your own address is a mailbox you connected. A block a channel can't render is either dropped, meaning the block is removed and the surrounding text is still sent, or sent as text lines, described under the table.

| Component | Native | Degraded | Dropped |
| - | - | - | - |
| [`list-item`](https://docs.heylua.ai/channels/formatting/list-item) | Web widget, WhatsApp, Messenger, Instagram, Slack, Teams, RCS, MessageBird, email (your own address) | iMessage: text and image; SMS, Front, email (generated inbox): one text line | — |
| [`horizontal-list-item`](https://docs.heylua.ai/channels/formatting/horizontal-list-item) | Web widget, WhatsApp, RCS | Messenger, Instagram, Slack: as `list-item`; email (your own address): a card; iMessage: text and image; SMS, Front, email (generated inbox): one text line | Teams, MessageBird |
| [`actions`](https://docs.heylua.ai/channels/formatting/actions) | Web widget, WhatsApp, Messenger, Instagram, Slack, Teams, RCS, MessageBird | iMessage, SMS, Front, email (generated inbox): numbered text | Email (your own address) |
| [`links`](https://docs.heylua.ai/channels/formatting/links) | Web widget, WhatsApp, Slack, Teams, RCS, iMessage, email (your own address) | SMS, Front, email (generated inbox): the URLs as text | Messenger, Instagram, MessageBird |
| [`images`](https://docs.heylua.ai/channels/formatting/images) | Web widget, Messenger, Instagram, Slack, Teams, RCS, iMessage, email (both forms) | WhatsApp: one collage; MessageBird: first three; SMS, Front: the URLs as text | — |
| [`documents`](https://docs.heylua.ai/channels/formatting/documents) | Web widget, WhatsApp, Teams, RCS, iMessage, email (generated inbox), Slack (files with `files:write`) | MessageBird: label and URL as text; Slack: links without `files:write`; email (your own address): a link card; SMS, Front: the URLs as text | Messenger, Instagram |
| [`payment`](https://docs.heylua.ai/channels/formatting/payment) | Web widget, WhatsApp, Messenger, Instagram, Slack, Teams, email (your own address) | iMessage, MessageBird: URL as text; SMS, Front, email (generated inbox): `Pay:` and the URL | RCS |
| [`form`](https://docs.heylua.ai/channels/formatting/form) | Web widget, Lua Desktop, the dashboard chat, the mobile app and Frontline, once they declare `forms-v1` | Every messaging channel, SMS, Front and email (both forms): the questions as numbered text | Voice |
| [`flow`](https://docs.heylua.ai/channels/formatting/flow) | WhatsApp | Web widget, the Lua apps, email (your own address): the text plus a line naming the button; SMS, Front, email (generated inbox): one text line | The other messaging channels |
| [`navigate`](https://docs.heylua.ai/channels/formatting/navigate) | Web widget with an `onNavigate` handler | — | Everywhere else; nothing is shown |
| [`reaction`](https://docs.heylua.ai/channels/formatting/reaction) | WhatsApp, Instagram, Messenger, Slack, iMessage, web widget, the Lua apps | Teams, RCS, MessageBird, SMS, Front, email (generated inbox): emoji as text; Messenger, Slack, iMessage: unmapped emoji as text | Email (your own address) |

SMS, Front, and a generated inbox send a reply as plain text. The prose comes first, then each block as text lines: a card as `title — subheading — description`, choices as a numbered list, links, images, and files as their URLs, a payment as `Pay:` and its URL, and a flow as one line; a generated inbox sends `images` and `documents` as attachments instead. A message you send from code with [`Channels.send`](https://docs.heylua.ai/build/send-proactive-messages) to SMS, Front, or a generated inbox is sent as written, blocks included, so keep those to plain text. Your own address renders blocks into HTML.

## Channel-scoped instructions

A block that works on one channel can leak on another, so scope the instruction: "On WhatsApp, send the verification flow …", or in a tool read `Lua.request.channel` and return the block only where it renders (see [`Lua`](https://docs.heylua.ai/reference/sdk/lua)). When in doubt, `list-item`, `actions`, `images`, and `payment` travel furthest; every other block has a channel list to check first.

## Limits

| Limit | Value |
| - | - |
| Items per `list-item` or `horizontal-list-item` reply | 10; WhatsApp sends lists in chunks of 9 rows |
| A reply whose only block is one `list-item`, on the messaging channels | Sent as text with the title in bold, not as a card; send 2 or more for cards |
| Carousel on WhatsApp | 2 to 10 cards; card text capped at 135 characters |
| Entries per `actions` block | 10; WhatsApp shows 1 or 2 as buttons, more as a list |
| Several blocks of one kind on messaging channels | Merged into one: repeated `actions` entries are removed, and WhatsApp sends only the first `payment` link |
| Reactions per reply | 1 |

## Next steps

> [card] [list-item](https://docs.heylua.ai/channels/formatting/list-item.md)
>
> The component most replies start with.

> [card] [Write skill context](https://docs.heylua.ai/build/write-skill-context.md)
>
> Where component instructions belong.

> [card] [Send proactive messages](https://docs.heylua.ai/build/send-proactive-messages.md)
>
> Blocks in messages the agent starts.

> [card] [Channels](https://docs.heylua.ai/concepts/channels.md)
>
> Every channel and its inbound and outbound names.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.