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. API and Development

Chat Panel

API and Development

View SourceOpens in a new tabSubmit IssueOpens in a new tab
PropTypeDefaultNotes
itemsreadonly MessageListItem[]requiredThe transcript, oldest first
labelLocalizedMessagerequiredNames the transcript log
jumpToLatestLabelLocalizedMessagerequiredNames the jump control
jumpUnreadLabel(count: number) => LocalizedMessageNames the jump control when messages arrived out of view
unreadCountnumberMessages that arrived out of view. Caller-owned
onReachStart() => voidThe oldest loaded message scrolled into view
onAtEndChange(atEnd, details) => voidThe reader reached or left the latest message
emptyTitleLocalizedMessagerequiredEmpty state title
emptyDescriptionLocalizedMessage | DisplayValueEmpty state description
emptyIconGlyphGlyph in the empty state's icon well
composerReactNodeA ChatInput: Reflow in Default, Stacked in Annotation. Omit for a read-only transcript
variantChatPanelVariantDefaultDefault or Annotation
messageVariantMessageVariantthe variant'sDraws every message the same way
showAuthorbooleantrueAvatar and author line
classNamestringAppended to the root
idstringRoot id
refRef<HTMLDivElement>Root element
Slots
SlotPropNotes
ComposercomposerAccepts a ChatInput. Floats over the transcript in Default, docked in Annotation. The caller passes the input's layout (Decision CP-8)
Exports
ChatPanel, ChatPanelVariant and ChatPanelProps from @prepared911/ui/blocks/chat-panel.
Props
NameTypeDefaultDescription
emptyTitleLocalizedMessage—Title of the empty state, shown when there are no items.
itemsreadonly MessageListItem[]—The transcript, oldest first: message and system items, as for MessageList.
jumpToLatestLabelLocalizedMessage—Accessible name of the control that jumps to the latest message.
labelLocalizedMessage—Accessible name of the transcript, which is a log region.
classNamestring—Classes appended to the root.
composerReactNode—The composer, such as a chat input with its send control. Omit it for a read-only or terminal transcript. In the default variant it floats over the block end of the transcript; in the annotation variant it is docked under it.
emptyDescriptionLocalizedMessage | DisplayValue—Description of the empty state.
emptyIconGlyph—Glyph in the empty state's icon well. Decorative.
idstring—Id of the root element.
jumpUnreadLabel((count: number) => LocalizedMessage)—Accessible name of the jump control when messages arrived out of view. Receives the count.
messageVariantMessageVariant—Overrides the variant's per-side treatment, drawing every message the same way. A layout that hides the author line has only the bubble left to mark a turn, so a split by side can read as an inconsistency there.
onAtEndChange((atEnd: boolean, details: ChangeDetails<ChangeReason.None>) => void)—Called when the reader reaches or leaves the latest message.
onReachStart(() => void)—Called when the oldest loaded message scrolls into view, to load earlier ones.
refRef<HTMLDivElement>—Ref to the root element.
showAuthorboolean—Whether messages draw the avatar and author line. Defaults to true. Hidden, each name stays for assistive technology and each time becomes a caption under its message.
unreadCountnumber—Messages that arrived while the reader was away from the latest one. The caller owns the number.
variantChatPanelVariant—The form factor. Defaults to {@link ChatPanelVariant.Default}.
Storybook
Interactive examples and edge cases for this component are in Storybook.
DefaultOpens in a new tab
Previous
Chat Panel / Usage
Next
Chat Panel / Accessibility
On this page
Slots
Exports
Props
Storybook