Skip to content

ChatMessage

Category: Chat

<ChatList>
<ChatMessage role="assistant" avatar={<Avatar fallback="HX" />} name="helix-ui" time="now">
Hello — how can I help today?
</ChatMessage>
<ChatMessage role="user" avatar={<Avatar fallback="ST" />} time="just now">
Show me a streaming reply.
</ChatMessage>
</ChatList>
{
/* bubble (default): user right, assistant left, system centered */
}
<ChatMessage role="user">…</ChatMessage>;
{
/* inline: avatar + name + content (Slack-style) */
}
<ChatMessage variant="inline" avatar={<Avatar fallback="AL" />} name="Alice" time="9:42 AM">
Just deployed the new version.
</ChatMessage>;

Install: @helix-ui/core

import { ChatMessage } from '@helix-ui/core';

status: stable · since: 0.3.0

Tags: bubble, message, role, user, assistant

[avatar] Name · time
┌──────────────────────┐
│ message body… │
└──────────────────────┘
[optional footer]
  • display — block
  • width — fill
  • height — content
  • intrinsicSize — left or right aligned by role, max ~720px wide
  • stackable — true
  • fullBleed — false

A row containing an avatar, a name + timestamp meta line, and a content bubble. User messages typically right-align with brand-tinted bubble; assistant left-aligns with neutral surface. The inline variant strips the bubble for Slack-style flat feeds.

Name Type Default Description
role 'user' | 'assistant' | 'system' assistant Speaker. user aligns right (in bubble variant); system centers and dims.
variant 'bubble' | 'inline' bubble bubble for messenger UIs; inline for thread-style chat.
avatar ReactNode — Avatar element rendered to the left (or right, for user).
name ReactNode — Display name. Position depends on variant.
time ReactNode — Timestamp or relative time (‘2m ago’).
pending boolean false Mute the bubble while a message is being sent or streamed.
footer ReactNode — Slot below the bubble — reactions, ToolCall, CitationList.
  • children — message content (text, MarkdownMessage, CodeBlock, etc.)

color.bg.action.brand.default, color.bg.action.neutral.default, color.text.primary, color.text.muted, color.text.on.brand, radius.lg, radius.sm, space.1, space.2, space.3, space.4, font.family.sans, font.size.xs, font.size.sm, font.weight.semibold

Notes

  • The bubble itself is a styled <div>. Provide a sensible reading order; screen readers announce children + meta.
  • For lists of messages, wrap in <ChatList> which is a role="log" container.
Component Relation Note
ChatList parent Always inside a ChatList.
Avatar child Leading avatar.
ToolCall child Tool calls render inside an assistant message.
ThinkingBlock child Reasoning summary inside an assistant message.
ChatComposer sibling
TypingIndicator sibling
ChatHeader sibling

These are the AI prompt → JSX mappings used by the helix-ui prompt DSL and integrations like Cursor / Claude Code.

“a user message saying hello”

<ChatMessage role="user">Hello!</ChatMessage>

“show an assistant reply with a streaming caret”

<ChatMessage role="assistant">
{streamedText}
<StreamingIndicator />
</ChatMessage>