Axon 911 Frontend DocsAxon 911 Frontend Docs
Axon 911 Frontend Docs
    Loading navigation…
U
User
Switch to light mode
  1. Blocks
  2. Chat Panel
  3. Usage

Chat Panel

Usage

ChatPanel is a ready-made chat surface: the transcript and a composer slot, with one owner of the spacing in the form factor the variant selects. It composes MessageList (which holds ChatScroll, Message and SystemMessage). It extends those existing components rather than adding a second set: everything it does, they do, and the block only picks their options together.
The panel fills the block size of its container, so the container must bound it (a fixed height, a flex or grid track).
When to use
  • A conversation with an agent or between people that needs the transcript, an empty state and a composer in one place.
  • The same transcript in two form factors, chosen explicitly and not inferred from width.
When not to use
  • A transcript with no composer beside it and no form-factor chrome to own: use MessageList.
  • A scroll region of anything other than messages: use ChatScroll or Scrollable.
Variants
VariantMessagesTimeComposer
DefaultThe reader's own in bubbles, the others plainAfter the nameFloats over the block end of the transcript on a fade
AnnotationPlain for both sidesUnder the nameDocked under the transcript, with a rule between
Both variants have one rhythm and there is no density option: a 24px gutter, with 28px between items of one sender and 44px at a change of sender or around a system line. Those values are provisional (owner-confirm 7 in the contract). messageVariant and showAuthor override the variant's choice for a host the form factor does not fit. With showAuthor={false} each name stays for assistive technology and each time drops to a caption under its message; pair it with messageVariant={MessageVariant.Bubble} so the bubble marks the turn.
Items
items are MessageList's: { kind, id, props }. A message carries Message's own props, so a turn is told by its AI SDK role and an identity, and takes its parts through slots:
The block imports none of the parts. reasoning, parts and attachments are slots on the message; the body is children, which is where TokenizedText or a response part goes.
Composer
composer is a slot that takes a ChatInput. The block imports no input and sets no prop on it, so the caller passes the input's layout, and the form factor decides which:
VariantChatInput layoutWhy
DefaultChatInputLayout.ReflowThe surface floats over the transcript, and its controls wrap around the text as it grows
AnnotationChatInputLayout.StackedThe surface sits flush under the rule, with the controls in a row under the text, in a narrow popover
Omit composer for a read-only or archived transcript. It sits outside the log, so typing and sending are not announced as transcript. The panel keeps the latest message clear of a floating composer as the input grows with its lines.
Empty
With no items the empty state shows inside the log (emptyTitle, emptyDescription, emptyIcon), and the floating composer still floats over its end.
Scroll behavior
unreadCount, jumpUnreadLabel, onReachStart and onAtEndChange are ChatScroll's, passed through. Loading earlier messages uses MessageList's loading and errorRow, which the block does not expose; use MessageList directly for a transcript that pages history.
Migrating from ui-ai-elements
Chat becomes ChatPanel, a ChatInput in composer and MessageList items, with one density and required copy props. The prop-by-prop mapping, the ChatMessage and PromptInput tables, the Ally avatar and the out-of-scope dictation are in Migrating from ui-ai-elements.
Previous
Call Dock / Accessibility
Next
Chat Panel / API and Development
On this page
When to use
When not to use
Variants
Items
Composer
Empty
Scroll behavior
Migrating from ui-ai-elements