ChatmotionChatmotion

API Reference

Types and props for the detail-oriented

ChatAnimation Props

PropTypeDefaultNotes
variant'phone' | 'simplified' | 'minimal''phone'Changing this remounts the component
isDarkModebooleanfalse
showAvatarsbooleantrue
showReactionsbooleantrue
showReceiptsbooleantrue
showGifsbooleantruePhone mode only
soundEnabledbooleanfalseNeeds user interaction first
responseStyle'dots' | 'streaming' | 'instant''dots'
fadeMode'none' | 'half''none'Simplified/minimal only
maxVisibleMessagesnumberundefinedSimplified/minimal only
pageDarkModebooleanfalseFor fade gradient color
conversationsConversation[]Default demo
themeColorsThemeColorsResolvedChatmotion theme
typingSpeednumber1.0Lower = faster
aiAvatarSrcstringAuto-generated
userAvatarSrcstringAuto-generated

Types

type Conversation = {
  question: string;
  questionImage?: string;      // URL, phone mode only
  answer: string;
  answerImage?: string;        // URL, phone mode only
  triggerReaction?: boolean;
  selectedReaction?: string;   // One of: ❤️ 👍 👎 😂 🥺 😭 🔥
};
type ThemeColorsResolved = {
  userBubble: string;   // Can be a CSS gradient
  aiBubble: string;     // Solid color
  aiBorder: string;     // Solid color
  accent: string;       // Solid, usually with alpha
  screenBg: string;     // Solid color
};
interface ChatAnimationRef {
  startAnimation: () => void;
  pauseAnimation: () => void;
  resetAnimation: () => void;
}

Imports

import { ChatAnimation } from '@/components/chat-animation';
import type { 
  Conversation,
  ThemeColorsResolved,
  ChatAnimationRef 
} from '@/components/chat-animation';
import { getThemeColors } from '@/lib/themes';

Edge Cases Worth Knowing

On this page