Skip to main content

Common Examples

To use the ChatLayout, give it a parent with a real height and pass conversation and prompt as configured slots. The kit forbids children. The column fills a narrow region and caps at 768px when wider.

Slots

Both slots are optional. Omit conversation for a prompt-only landing. Omit prompt for a transcript with no composer. The prompt stays bottom-pinned in both cases.

Stick to bottom

New messages stick the transcript to the bottom. Scrolling up to read history stops auto-scroll. Scrolling back to the bottom re-engages the lock. A floating scroll to latest button appears while the user is not at the bottom.

Scroll after send

The layout cannot infer when the user sends. Pass controlRef and call scrollToBottom() after send so the transcript snaps to the latest regardless of scroll position.

Internationalization

ChatLayout owns these localized strings:
  • ai-kit.chatLayout.conversation
  • ai-kit.chatLayout.scrollToBottom
Mount AiKitIntlProvider inside CartoTheme to switch them.

React Accessibility

  • The transcript is a role="log" live region. Appended messages are announced.
  • Render streaming token nodes as non-live and let the final message land in the log.
  • controlRef.current.isAtBottom mirrors whether the scroll-to-latest button is shown.
Last modified on August 28, 2026