EXEPERTAI LAB

Research alpha

Time Machine
EXEPERTAI LAB
GALLERY / COLLECTION
← Browse Astryx gallery
Chat·component·@astryxdesign/core

Chat Message

Sender context wrapper: handles avatar, name, metadata, and alignment based on sender role.

Open in Playground @astryxdesign/core/Chat

Showcases and examples

4 documented examples

Chat Message

A user multi-bubble group with delivery status and an assistant ghost response with avatar, name, timestamp, and model info.

Preview loads on approachPreview loads on approach
Exact source · chat-message-showcase
// Copyright (c) Meta Platforms, Inc. and affiliates.

'use client';

import {
  ChatMessageList,
  ChatMessage,
  ChatMessageBubble,
  ChatMessageMetadata,
} from '@astryxdesign/core/Chat';
import {Timestamp} from '@astryxdesign/core/Timestamp';
import {Text} from '@astryxdesign/core/Text';

export default function ChatMessageShowcase() {
  return (
    <ChatMessageList style={{maxWidth: 600}}>
      <ChatMessage sender="user">
        <ChatMessageBubble group="first">
          I just pushed the refactored auth module.
        </ChatMessageBubble>
        <ChatMessageBubble
          group="last"
          metadata={
            <ChatMessageMetadata
              timestamp={
                <Timestamp value="2026-04-28T14:30:00" format="time" />
              }
              status="read"
            />
          }>
          Can you review the token validation changes?
        </ChatMessageBubble>
      </ChatMessage>
      <ChatMessage sender="assistant">
        <ChatMessageBubble
          variant="ghost"
          metadata={
            <ChatMessageMetadata
              timestamp={
                <Timestamp value="2026-04-28T14:31:00" format="time" />
              }
              footer={
                <Text type="supporting" color="secondary">
                  Claude Opus 4.6
                </Text>
              }
            />
          }>
          Looks good — the refresh token rotation is solid and the error
          handling covers all the edge cases. Ship it.
        </ChatMessageBubble>
      </ChatMessage>
    </ChatMessageList>
  );
}

Usage

Sender context wrapper: handles avatar, name, metadata, and alignment based on sender role.

Typed props

PropType and behavior
sender'user' | 'assistant' | 'system' · required
Who sent this message: controls alignment and layout.
childrenReactNode · required
Free-form content: bubbles, asset lists, tool calls, images. Custom (non-bubble) children render flush with the message edge; wrap them in a ghost ChatMessageBubble to align them with the bubble text column.
avatarReactNode
Avatar element rendered beside the message. Typically Avatar.
Slot: Avatar
nameReactNode
Sender name rendered above the message body. Use when the first child is raw content (not a bubble). If the first child is a bubble, put the name on the bubble's name prop instead.
metadataReactNode
Metadata rendered below the message body. Use when the last child is raw content (not a bubble). If the last child is a bubble, put metadata on the bubble's metadata prop instead.
Slot: Text
density'compact' | 'balanced' | 'spacious'
Visual density. Inherited from list context if not set.