Skip to content

Chat Message

@astryxdesign/core v0.7.1 · ChatMessage

Props ​

PropTypeDefaultDescription
sender'user' | 'assistant' | 'system'—Who sent this message: controls alignment and layout. Required. A system row is centered and ignores the avatar, name, and metadata slots.
namestring—Plain sender name rendered above the body. Use it when the first child is raw content, not a bubble; with bubbles, set the name on the first bubble instead so it lines up with the bubble padding.
densityChatDensitylist value, then 'balanced'Visual density: 'compact', 'balanced', or 'spacious'. Inherited from the surrounding ChatMessageList when not set.

Slots ​

  • default: message content: bubbles, tool calls, reasoning, or raw nodes. Custom content renders flush with the message edge; wrap it in a ghost ChatMessageBubble to align it with the bubble text column.
  • avatar: element rendered beside the message, typically Avatar. Ignored when sender is system.
  • name: replaces the name prop.
  • metadata: rendered below the body. Use it when the last child is raw content, not a bubble; with bubbles, use the bubble's metadata slot instead.

Exposed ​

  • element: the root <article> element.