Skip to main content
Version: 1.0.3

AIMessageBubble

The AIMessageBubble styles and structures messages for chat-based AI interfaces. It aligns messages according to sender roles, supports user/assistant avatars, handles copy-to-clipboard functionality, provides hover actions, and scales with smooth entrance animations.

Session started. AI assistant initialized.
You
You11:01 AM
Can you show me how to style a button in Tailwind?
Assistant
Assistant11:01 AM
Certainly! Here is a standard button class: <button className="px-4 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition-colors"> Click Me </button>

Installation

ignix add component ai-message-bubble

Usage

Import the component:

import { AIMessageBubble } from '@mindfiredigital/ignix-ui';

Basic Example

<AIMessageBubble
role="assistant"
shape="bubble"
content="Hello! How can I help you?"
/>

With Avatar and Timestamp

<AIMessageBubble
role="assistant"
shape="bubble"
senderName="Assistant"
timestamp="12:35 PM"
avatar="/path-to-avatar.png"
content="I can help you build responsive web apps."
/>

Glassmorphic Variant

Perfect for dark themes, hero sections, and image backgrounds:

<AIMessageBubble
role="assistant"
shape="bubble"
variant="glass"
content="I am rendering inside a blur-background glass bubble."
/>

Props

PropTypeDefaultDescription
contentReact.ReactNode-The message text or rich layout to display (required)
role'user' | 'assistant' | 'system''assistant'The role of the sender, determining alignment and visual themes
variant'default' | 'minimal' | 'glass''default'Bubble containers visual theme
avatarReact.ReactNodeundefinedCustom avatar (image URL or custom React Node)
senderNamestringundefinedSender's name displayed above the message bubble
timestampstringundefinedMessage timestamp displayed next to the sender's name
actionsReact.ReactNodeundefinedCustom action buttons rendered inside the hover action bar
showCopybooleanfalseShows a built-in copy-to-clipboard button
animateEntrybooleantrueSlide-up and fade-in entry animation when component mounts
shape'bubble' | 'card' | 'pill' | 'flat'bubbleControls the visual shape of the message bubble.