Skip to main content

XBubble

Chat message bubble component for displaying AI and user messages.

Source: Re-exported from @ant-design/x. Full documentation: Ant Design X Bubble

Basic Usage

import { XBubble } from '@vef-framework-react/components';

export default function Demo() {
return (
<>
<XBubble content="Hello! How can I help you?" placement="start" />
<XBubble content="Tell me about VEF Framework." placement="end" />
</>
);
}

With Avatar

<XBubble
content="I can help with that!"
placement="start"
avatar={{ src: '/ai-avatar.png', alt: 'AI' }}
/>

Markdown Content

import { XBubble, XMarkdown } from '@vef-framework-react/components';

<XBubble
placement="start"
content="Here is some **markdown** content with `code`."
messageRender={(content) => <XMarkdown>{content}</XMarkdown>}
/>

Streaming / Loading

<XBubble
placement="start"
content={streamingContent}
loading={isStreaming && !streamingContent}
/>

API

PropTypeDefaultDescription
contentReactNodeMessage content
placement'start' | 'end''start'Bubble position (start = left, end = right)
avatarAvatarProps | ReactNodeAvatar config or element
loadingbooleanfalseShow loading dots
typingboolean | { step, interval }falseTyping animation config
messageRender(content: string) => ReactNodeCustom content renderer
headerReactNodeContent above the bubble
footerReactNodeContent below the bubble
shape'round' | 'corner''round'Bubble shape
variant'filled' | 'borderless' | 'outlined' | 'shadow''filled'Visual variant

For the full API, see Ant Design X Bubble docs.