Preview
Features
- Authentic iOS styling - Matches iMessage’s visual design
- Message grouping - Automatic grouping for consecutive messages
- Bubble tails - Dynamic tails that show/hide based on grouping
- Sent/received variants - Distinct styles for user and bot messages
- Flexible content - Supports both text and custom children
- Responsive design - Adapts to different screen sizes
Installation
Usage
Single Message
Sent Message
Grouped Messages
Using ChatMessage Component
TheChatMessage component automatically handles grouping for you:
Custom Content
Full Chat Interface
Props
MessageBubble
The text content to display in the bubble.
The message variant -
sent for user messages (blue, right-aligned), received for bot/other messages (gray, left-aligned).Grouping state for consecutive messages:
first- First message in a group (tail visible, tight bottom corners)middle- Middle message (no tail, tight both sides)last- Last message (tail visible, tight top corners)none- Standalone message (tail visible, full rounded)
Additional CSS classes for the bubble container.
Custom content to render instead of the message text.
ChatMessage
Array of message strings to display as grouped bubbles.
The message variant for all bubbles in this group.
Timestamp to display below the message group.
Whether to show the timestamp.
Additional CSS classes for the container.
Styling Details
Color Scheme
- Sent messages - Gaia UI primary color (#00bbff)
- Received messages - Light gray (zinc-300) in light mode
- Text color - Black for readability on both backgrounds
Bubble Dimensions
- Max width - 60vw to prevent bubbles from stretching too wide
- Padding - 8px vertical, 20px horizontal for comfortable reading
- Border radius - 20px for the classic rounded bubble look
Grouping Behavior
- First message - Full radius on top, tight radius on bottom (stacking side)
- Middle messages - Tight radius on both sides (stacking side)
- Last message - Tight radius on top, full radius on bottom (stacking side)
- Tails - Only visible on last message or standalone messages
Accessibility
- Semantic HTML with proper text rendering
- Sufficient color contrast for readability
- Screen reader friendly markup
- Supports pre-wrap for multi-line messages
Design Notes
- Based on iOS iMessage design patterns
- Uses CSS pseudo-elements for authentic tail effects
- Supports both light and dark modes
- Optimized for touch interfaces with generous spacing
Common Patterns
Auto-grouping Messages
When building a chat interface, you’ll want to automatically group consecutive messages from the same sender:Related Components
- Composer - Chat input component
- Tool Calls Section - Display AI agent actions