Skip to main content

AI Components (X) Overview

VEF Framework includes a set of AI/chat UI components from @ant-design/x, re-exported with the X prefix. These components are designed for building AI-powered conversational interfaces.

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

Available Components

Export NameAnt Design X ComponentDescription
XBubbleBubbleChat message bubble
XSenderSenderMessage input with send button
XConversationsConversationsConversation list
XPromptsPromptsSuggested prompt list
XThoughtChainThoughtChainAI reasoning chain display
XWelcomeWelcomeWelcome screen
XAttachmentsAttachmentsFile attachment area
XActionsActionsMessage action buttons
XSuggestionSuggestionInline suggestion list
XSourcesSourcesReference sources display
XFileCardFileCardFile preview card
XThinkThinkAI thinking/loading indicator
XNotificationnotificationAI notification utility
XMarkdownVEF wrapperMarkdown renderer with streaming
XMermaidVEF wrapperMermaid diagram renderer
XCodeHighlighterVEF wrapperCode block for AI responses

Import

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

Minimal Chat Example

import { XBubble, XSender, Stack } from '@vef-framework-react/components';
import { useState } from 'react';

interface Message {
id: number;
role: 'user' | 'assistant';
content: string;
}

export default function ChatDemo() {
const [messages, setMessages] = useState<Message[]>([]);
const [value, setValue] = useState('');

const handleSend = (text: string) => {
setMessages((prev) => [
...prev,
{ id: Date.now(), role: 'user', content: text },
]);
setValue('');
// Call your AI API here...
};

return (
<Stack style={{ height: '100%' }}>
<div style={{ flex: 1, overflow: 'auto', padding: 16 }}>
{messages.map((msg) => (
<XBubble
key={msg.id}
placement={msg.role === 'user' ? 'end' : 'start'}
content={msg.content}
/>
))}
</div>
<XSender
value={value}
onChange={setValue}
onSubmit={handleSend}
placeholder="Ask anything..."
/>
</Stack>
);
}