ChatBubble

Message bubble for chat and messaging UIs with avatar, name, and timestamp support

Category: display · WCAG 2.2-AA · chat, message, conversation, messaging

Variants

Props

PropTypeDefaultDescription
childrenReact.ReactNode—Content rendered inside the component.
side'start' | 'end'startWhich side of the thread the bubble sits on: `start` for an incoming message (avatar first), `end` for an outgoing one (right-aligned, avatar last).
avatarReact.ReactNode—Avatar element shown beside the message.
namestring—Display name of the message sender.
timestring—Timestamp text shown with the message.
classNamestring—Additional CSS class names merged onto the root element.

Design tokens

When to use

When not to use

How to build an accessible ChatBubble in React →

Examples

Incoming message

Message from another user, aligned to the start

<ChatBubble side="start" name="Alice" time="10:42 AM">Hey, how are you?</ChatBubble>

Outgoing message

Current user message, aligned to the end with accent background

<ChatBubble side="end" time="10:43 AM">Doing great, thanks!</ChatBubble>

With avatar

Message with an avatar beside the bubble

<ChatBubble side="start" avatar={<Avatar src="/alice.png" size="sm" />} name="Alice">See you tomorrow!</ChatBubble>

Related components

← Back to docs