Components
React components for building VAssist’s 3D character interface, chat UI, and AI-powered toolbar.VirtualAssistant
High-level wrapper component managing the 3D scene, animations, and character positioning.Props
Callback when assistant is initialized. Receives object with
animationManager, positionManager, and scene.Enable preview mode for setup wizard (renders inline instead of portal)
Width for preview mode
Height for preview mode
Additional CSS classes for preview container
Enable portrait mode in preview (clips model at waist)
Position preset for preview mode
Ref Methods
Access these methods via ref:text: Text to speakmouthAnimationBlobUrl: Blob URL to BVMD file with lip-sync animationemotionCategory: Animation category (‘talking’, ‘idle’, ‘thinking’, ‘celebrating’, ‘walking’)options: Blending weights for composite animations
AssistantState enum or emotion string.AIToolbar
Floating context-aware toolbar for text and image operations. Appears on text selection, input focus, or image hover.Features
- Summarization: TL;DR, headline, key points, teaser
- Translation: Auto-detect source language, translate to target
- Image Analysis: Describe, extract text, analyze images
- Text Rewriting: Grammar fix, tone adjustment, length changes
- Content Writing: Generate new content from prompts
- Voice Dictation: Speech-to-text for editable fields
- Language Detection: Identify text language
Usage
AIToolbar is automatically rendered and managed by the application. It appears contextually based on user actions.Toolbar Triggers
Toolbar Triggers
- Text Selection: Shows summarize, translate, rewrite options
- Input Focus: Shows dictation button
- Image Hover: Shows image analysis options
- Editable Content: Shows insert/replace options after processing
ChatContainer
Main chat interface managing messages, TTS playback, history, and settings.Props
Whether 3D model is disabled (chat-only mode)
Callback to handle dropped content (images, audio, text)
Features
- Message Display: Streaming text with smooth animation
- TTS Playback: Text-to-speech for AI messages
- Branch Navigation: Navigate between message variations
- Chat History: Save/load conversations
- Settings Panel: Configure AI, TTS, STT, UI
- Drag & Drop: Attach images and audio files
- Background Detection: Adaptive light/dark theme
ChatInput
Chat input component with voice recording, multimodal attachments, and drag-drop support.Props
Callback when input is closed (Esc key)
Callback for voice transcription results
Features
- Text Input: Multi-line textarea with auto-resize
- Voice Recording: One-shot speech-to-text
- Voice Conversation: Continuous back-and-forth conversation
- Image Attachments: Upload or paste up to 5 images (max 10MB each)
- Audio Attachments: Upload up to 3 audio files (max 25MB each)
- Drag & Drop: Drop files directly onto input
- Keyboard Shortcuts: Enter to send, Shift+Enter for new line, Esc to close
BabylonScene
Babylon.js 3D scene component managing scene initialization, rendering, and cleanup.Props
Scene configuration object passed to builder
Ref to PositionManager instance for drag-drop overlay positioning
Render as inline preview instead of full-screen portal
Width for preview mode
Height for preview mode
Additional CSS classes for preview container
Features
- Automatic Initialization: Creates engine and scene on mount
- FPS Limiting: Configurable frame rate limiting (30/60/90/native)
- Drag & Drop Overlay: Positioned over 3D model for file drops
- Resource Cleanup: Proper disposal of Babylon resources on unmount
- Portal Rendering: Renders to document.body in production mode
- Preview Mode: Inline rendering for setup/configuration UIs
Scene Metadata
The scene builder should attach managers toscene.metadata:
Usage Examples
Basic Virtual Assistant
Basic Virtual Assistant
Chat with Input
Chat with Input
Custom 3D Scene
Custom 3D Scene