- Implementation
- ChatLayout Props
- ChatLayoutHandle
Common Examples
To use theChatLayout, 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. Omitconversation 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. PasscontrolRef 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.conversationai-kit.chatLayout.scrollToBottom
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.isAtBottommirrors whether the scroll-to-latest button is shown.