Skip to content

Chat Message Bubble

@astryxdesign/core v0.7.1 · ChatMessageBubble

Props ​

PropTypeDefaultDescription
variant'filled' | 'ghost''filled''filled' paints the sender-colored background. 'ghost' keeps the padding and drops the background, so mixed content still lines up. A bubble whose only child is a code block, or an element with class astryx-chat-card, drops the padding and background so the card lines up with the bubble.
namestring—Sender name rendered above the bubble, aligned to the bubble inline padding. Use it on the first bubble of a message; when the first content is raw, use ChatMessage's name instead.
group'first' | 'middle' | 'last'—Position within a multi-bubble group. Tightens the corner radius on the sender side. Leave it unset for a standalone bubble.
widthstring—Overrides the default cap of max(80%, 280px). Pass 100% when in-bubble content should span the message column. Combine it with variant="ghost" for artifact cards and attachments.

Slots ​

  • default: bubble body. Plain text, markdown, or any element. The bubble only supplies the surface.
  • name: replaces the name prop.
  • metadata: rendered below the bubble, aligned to the bubble padding. Use it on the last bubble of a message; when the last content is raw, use ChatMessage's metadata slot instead.

Exposed ​

  • element: the bubble surface element.