ChatBubble

A single message bubble for AI chat UIs, aligned left for assistant messages and right for user messages.

You2:41 PM
How do I center a div in CSS?
A
AI2:41 PM
You can use flexbox: set the parent to display: flex; justify-content: center; align-items: center.

import { ChatBubble } from "@aetherstack/ui"

Installation

terminal
npx aether-ui add chat-bubble

Import

import.tsx
import { ChatBubble } from "@aetherstack/ui"

Usage

chatbubble.tsx
<ChatBubble
  role="user"
  content="How do I center a div?"
  name="You"
  timestamp="2:41 PM"
/>

<ChatBubble
  role="assistant"
  content="Use display: flex with justify-content and align-items set to center."
  name="AI"
  timestamp="2:41 PM"
/>

Props

PropTypeDefaultDescription
role*"user" | "assistant" | "system"—Determines bubble alignment (user = right, assistant/system = left) and background color.
content*React.ReactNode—Message content — can be a string, MarkdownRenderer, or any React node.
avatarUrlstring—Custom avatar image URL shown beside the bubble.
namestring—Sender name shown above the bubble.
timestampstring—Timestamp string shown beside the sender name.
actionsReact.ReactNode—Action buttons (e.g. FeedbackButtons, copy) rendered below the bubble.
classNamestring—Additional CSS classes.

* Required

Accessibility

  • →Each bubble is wrapped in an article element with an appropriate aria-label containing the sender name.
  • →User and assistant bubbles are visually differentiated by alignment and color — not color alone.