A chat message component for building conversational interfaces with AI agents.
- 👥 Multiple Roles - User, assistant, and system message types
- 💬 Chat Bubbles - Clean, familiar chat interface
- ⚡ Streaming Support - Typewriter effect for AI responses
- 🖼️ Avatars - Support for images or initials
- ⏰ Timestamps - Display message time
- ✅ Status Indicators - Sending, sent, and error states
- 🎯 Action Buttons - Add interactive buttons below messages
- 🎨 Theme Compatible - Works with all shadcn themes
import { ChatMessage } from "@/patterns/chat-message/component"
<ChatMessage
role="assistant"
content="I can help you with that!"
timestamp={new Date()}
isStreaming={false}
/>role- "user" | "assistant" | "system"content- Message textavatar- URL or initialstimestamp- Date or formatted stringisStreaming- Enable typewriter effectstatus- "sending" | "sent" | "error"actions- Array of action buttonsclassName- Additional CSS classes
See example.tsx for complete examples including streaming messages, action buttons, and different states.
Perfect for:
- AI chat interfaces
- Customer support bots
- Conversational UIs
- Agent interactions