Axon 911 Frontend DocsAxon 911 Frontend Docs
Axon 911 Frontend Docs
    Loading navigation…
U
User
Switch to light mode
  1. Components
  2. Message
  3. API and Development

Message

API and Development

View SourceOpens in a new tabSubmit IssueOpens in a new tab
Message renders self/other aligned bubbles with optional role, name, and timestamp. Supports translation / translatedContent layouts (the two texts are positional: translatedContent shows first and children beneath it, so a consumer whose original must lead passes the original as translatedContent), floating toolbar content with Toolbar integration (toolbarProps, exclusiveToolbar, toolbarGroup), search affordances (focused, active), and MessageHighlight / MessageRedaction helpers for inline body text.
Message props
NameTypeDefaultDescription
actionsReactNode—Actions slot beside the content: real Buttons, a ButtonGroup, or a Toolbar. On hover-capable pointers it fades in on hover and whenever focus is inside it; touch and keyboard users always reach it. Message adds no role.
animatedboolean—Fades and slides the message in when it mounts. Defaults to false; a virtualized list should leave it off.
aria-descriptionLocalizedMessage—Extended description for assistive tech.
aria-labelLocalizedMessage—Accessible name when the visible label is insufficient.
aria-placeholderLocalizedMessage—Hint for an empty control.
as"div" | "article" | "li"—Host tag. Defaults to div. Use li inside a list and article inside a feed.
attachmentsReactNode—Attachments slot, below the content. Message lays it out and gives it no semantics.
authorMessageAuthor—Who wrote the message. Sets the side of the row, the side of the rule, and the rule paint. Not set: the side follows from.
authorNameMessageLabel—Visible author name.
authorRoleMessageLabel—Visible author role, such as a call-taker or responder label.
avatarReactNode—Avatar slot, usually a decorative Avatar beside the visible name. It sits at the author's side of the content. The default plain look shows no avatar, so omit it there; omit it from the messages of a run that should not repeat it.
childrenReactNode—Message content. Use {@link MessageHighlight } and {@link MessageRedaction } inside it. It renders in a block container with dir="auto", so rich children such as links and tokenized text are allowed.
classNamestring—Classes appended after the generated classes.
contentLangstring—Language of children as a BCP 47 tag, so assistive technology pronounces it. Language of children as a BCP 47 tag.
data-alignundefined——
data-checkedundefined——
data-copy-statusundefined——
data-dirtyundefined——
data-disabledundefined——
data-draggingundefined——
data-ending-styleundefined——
data-expandedundefined——
data-filledundefined——
data-focus-visibleundefined——
data-focusedundefined——
data-highlightedundefined——
data-hoveredundefined——
data-indeterminateundefined——
data-instantundefined——
data-invalidundefined——
data-is-newundefined——
data-loadingundefined——
data-nestedundefined——
data-openundefined——
data-orientationundefined——
data-overflowundefined——
data-placeholderundefined——
data-popup-openundefined——
data-pressedundefined——
data-readonlyundefined——
data-requiredundefined——
data-scrollingundefined——
data-selectedundefined——
data-sideundefined——
data-starting-styleundefined——
data-touchedundefined——
data-validundefined——
fromMessageRole—Role of the sender, as in the AI SDK. Does not change the side when author is set. Role of the sender, as in the AI SDK. A user message is outgoing; the other roles are incoming.
groupMessageGroup—Position in a run of consecutive messages from one author. Defaults to {@link MessageGroup.Single}.
highlightedboolean—The whole message is the current focus of a surrounding view, such as the match a search stepped to.
identityMessageIdentity—Who is speaking, as a name with an optional picture, glyph, and color. It draws the avatar (unless avatar is passed) and names the author (unless authorName is passed). Use it for a person or an agent that has a picture or a glyph; use avatar for any other avatar.
metaReactNode—Free-form metadata after the timestamp, such as "Worked for 5m 26s". Placed like timestamp: in the author line, or in the caption when the author is hidden.
metaPlacementMessageMetaPlacement—Where timestamp and meta sit in the author line: after the name (default) or beneath it. Ignored when showAuthor is false.
onRetryMouseEventHandler<HTMLButtonElement>—Not allowed without {@link MessageStatus.Failed}. Called when the retry Button is activated.
originalLabelLocalizedMessage—Not allowed without translatedContent. Announced before the second text (children), such as "Original message". Name whatever children holds.
partsReactNode—Parts slot, under the content and above the attachments: structured parts of the turn such as a confirmation, a task, a source list, or an artifact. The caller orders them. Message lays them out and gives them no semantics.
reasoningReactNode—Reasoning slot, above the content: a collapsible account of how the message was produced. Message lays it out and gives it no semantics.
refRef<HTMLElement>—Ref to the root element.
reserveAvatarboolean—Keeps the avatar column's width when there is no avatar, so a run of messages stays aligned.
retryLabelLocalizedMessage—Not allowed without {@link MessageStatus.Failed}. Label of the retry Button.
selectedboolean—The message is selected, such as the line a recording is playing.
showAuthorboolean—Whether the avatar and the author line are drawn. Defaults to true. A layout that tells speakers apart by side can hide them: the name stays in the accessibility tree, and timestamp and meta become a caption under the content.
statusMessageStatus—No delivery state shows. Delivery state.
statusLabelLocalizedMessage—Not allowed without a status. Names the state, such as "Sending" or "Sent". Visible for sending, available to assistive technology for sent. Visible failure text, such as "Not sent".
tabIndex-1—Only -1: a list may focus a message programmatically; a message is not a tab stop.
timestampReactNode—Time slot. Pass a Time element holding the localized text so the machine-readable instant stays in dateTime. Message formats nothing.
titleLocalizedMessage—Native tooltip; accessibility hint, not visible UI title text.
translatedContentReactNode—Not set. The text that shows first. By default the translation.
translatedLangstring—Not allowed without translatedContent. Language of translatedContent as a BCP 47 tag.
variantMessageVariant—Plain transcript line or bubble. Defaults to {@link MessageVariant.Plain}.
Storybook
Interactive examples and edge cases for this component are in Storybook.
DefaultOpens in a new tab
Helpers
NameTypeDefaultDescription
MessageHighlight{ current?: boolean }—Search hit mark.
MessageRedaction{ type: RedactionType }—Manual vs automated redaction styling.
Self message
Other message
Manual redaction
Automated redaction
Translated self message
Translated other message
Long message
With toolbar
Conversation
No metadata
Search highlight
Previous
Message / Usage
Next
Message / Accessibility
On this page
Message props
Storybook
Helpers
Self message
Other message
Manual redaction
Automated redaction
Translated self message
Translated other message
Long message
With toolbar
Conversation
No metadata
Search highlight