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.ReactNodeContent rendered inside the component.
side'start' | 'end'startEdge the component is anchored to.
avatarReact.ReactNodeAvatar element shown beside the message.
namestringDisplay name of the message sender.
timestringTimestamp text shown with the message.
classNamestringAdditional 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