@colossal-sh/chat-react) you host the widget inside your own app and extend it with custom component renderers: when an automation returns an output with a type you’ve registered, the widget renders your component instead of plain text.
The flow has two halves:
- In your app — define a component type and register a renderer for it.
- In the automation builder — ask for automations to return their result in the output format that type needs.
1. Register a component renderer
client prop. With the config prop the provider creates the client after the first render, so components that read the chat context on mount (including ChatWidget) throw “must be inside <ChatProvider>” unless you gate them with useHasChatClient().
componentRenderers maps a type string to a React component. The renderer receives the whole output object as payload, plus the raw tool part and message if you need them.
2. Ask the builder for that output format
An output is matched to a renderer when the step result the agent responds with is a JSON object carrying yourtype. When building the automation, tell the builder the exact shape your component expects:
When a customer asks about warranty, look up the order and finish with an output of the form
{ "type": "warranty_check", "productTitle": ..., "active": true/false, "expiresAt": ... }.
The builder wires the automation’s final step to produce that object. At runtime the widget sees type: "warranty_check", finds your renderer, and renders the card in the conversation.
If no renderer matches a type, the widget falls back to its default output rendering — so shipping the automation before the frontend (or vice versa) degrades gracefully.
Built-in component types
These types are rendered out of the box, and you can override any of them by registering your own renderer under the same key. All amounts are in minor units (cents).Product List
Product List
Type:
product_list — a horizontally scrollable list of product cards. Each card shows an Add button, which turns into a quantity stepper once the item is in the cart:Payloadarray
required
The products to show. Renders nothing when empty. Each item:
Cart Updated
Cart Updated
Types:
cart_add, cart_remove — a confirmation chip reading “Cart updated” for cart_add, “Item removed” for cart_remove.PayloadNo fields beyond type; the label is chosen from the type itself.Cart View
Cart View
Type:
cart_view — a summary card of the customer’s current cart, or an empty-cart state. Quantity steppers adjust items in place; on Shopify embeds the cart bridge keeps this in sync with the real storefront cart:PayloadNo fields beyond type; the card reads the live cart from the widget’s cart state rather than the payload.Order Details
Order Details
Type:
order_details — an order summary card with line items, total, addresses, and status, plus a tracking link when available:Payloadobject
required
Renders nothing without an
order.number.

