Thành phần bong bóng trò chuyện CSS Tailwind chỉ có CSS. Vị trí bắt đầu và kết thúc cho tin nhắn đã gửi và nhận, có hình đại diện và dấu thời gian. WCAG AA, hoạt động với Django, HTMX, Laravel, React và bất kỳ ngăn xếp nào.
Các thành phần trò chuyện hiển thị tin nhắn hội thoại ở định dạng có tổ chức, dễ đọc. Được xây dựng bằng HTML ngữ nghĩa và bố cục linh hoạt, bong bóng trò chuyện thể hiện cả thông báo của người dùng và hệ thống. Hệ thống trò chuyện Frutjam hỗ trợ nhiều màu sắc, cách sắp xếp và kiểu dáng — lý tưởng cho giao diện nhắn tin, bảng hỗ trợ khách hàng và giao diện người dùng đàm thoại.
Chỉ CSS, không cần JavaScript. WCAG AA có thể truy cập và không phụ thuộc vào khung — hoạt động với Django, HTMX, Laravel, React và bất kỳ ngăn xếp nào.
| Lớp học | Kiểu | Sự miêu tả |
|---|---|---|
| chat | Căn cứ | Wrapper for a single chat message row |
| chat-bubble | Công cụ sửa đổi | Styled message bubble |
| chat-avatar | Công cụ sửa đổi | Avatar displayed alongside the message |
| chat-header | Công cụ sửa đổi | Sender name or metadata above the bubble |
| chat-footer | Công cụ sửa đổi | Timestamp or status below the bubble |
| chat-start | Công cụ sửa đổi | Aligns bubble to the left (incoming message) |
| chat-end | Công cụ sửa đổi | Aligns bubble to the right (outgoing message) |
| chat-xs | Kích cỡ | Cực nhỏ |
| chat-sm | Kích cỡ | Bé nhỏ |
| chat-md | Kích cỡ | Trung bình (mặc định) |
| chat-lg | Kích cỡ | Lớn |
| chat-xl | Kích cỡ | Cực lớn |
| chat-bubble-primary | Màu sắc | Primary theme color bubble |
| chat-bubble-secondary | Màu sắc | Secondary theme color bubble |
| chat-bubble-accent | Màu sắc | Accent theme color bubble |
| chat-bubble-neutral | Màu sắc | Neutral theme color bubble |
| chat-bubble-info | Màu sắc | Info semantic color bubble |
| chat-bubble-success | Màu sắc | Success semantic color bubble |
| chat-bubble-warning | Màu sắc | Warning semantic color bubble |
| chat-bubble-error | Màu sắc | Error semantic color bubble |
Cách sử dụng cơ bản
1 2 3 4 5 6 7 | <div class="chat chat-start"> <div class="chat-bubble">Hello! How are you?</div> </div> <div class="chat chat-end"> <div class="chat-bubble">I'm doing great, thanks!</div> </div> |
1 2 3 4 5 6 7 | <div className="chat chat-start"> <div className="chat-bubble">Hello! How are you?</div> </div> <div className="chat chat-end"> <div className="chat-bubble">I'm doing great, thanks!</div> </div> |
Chat with Avatar
1 2 3 4 5 6 7 8 9 10 11 12 13 | <div class="chat chat-start"> <div class="chat-avatar avatar"> <div class="w-10 rounded-full bg-primary"></div> </div> <div class="chat-bubble">Hello!</div> </div> <div class="chat chat-end"> <div class="chat-avatar avatar"> <div class="w-10 rounded-full bg-secondary"></div> </div> <div class="chat-bubble">Hi there!</div> </div> |
Chat Sizes
1 2 3 4 5 6 7 8 9 10 11 | <div class="chat chat-start chat-sm"> <div class="chat-bubble">Small message</div> </div> <div class="chat chat-start chat-md"> <div class="chat-bubble">Medium message</div> </div> <div class="chat chat-start chat-lg"> <div class="chat-bubble">Large message</div> </div> |
Chat Styles
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | <div class="chat chat-start"> <div class="chat-bubble">Default style</div> </div> <div class="chat chat-start"> <div class="chat-bubble chat-bubble-primary">Primary message</div> </div> <div class="chat chat-start"> <div class="chat-bubble chat-bubble-secondary">Secondary message</div> </div> <div class="chat chat-start"> <div class="chat-bubble chat-bubble-accent">Accent message</div> </div> |
Chat Header and Footer
1 2 3 4 5 6 7 8 9 10 11 | <div class="chat chat-start"> <div class="chat-header">John</div> <div class="chat-bubble">Thanks! I'm looking forward to it.</div> <time class="text-xs opacity-50">12:45</time> </div> <div class="chat chat-end"> <div class="chat-header">You</div> <div class="chat-bubble">I'll see you tomorrow!</div> <time class="text-xs opacity-50">12:46</time> </div> |
Conversation Thread
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | <div> <div class="chat chat-start"> <div class="chat-avatar avatar"> <div class="w-10 rounded-full bg-primary"></div> </div> <div class="chat-bubble">Hello! How can I help?</div> </div> <div class="chat chat-end"> <div class="chat-avatar avatar"> <div class="w-10 rounded-full bg-secondary"></div> </div> <div class="chat-bubble">I need help with my order</div> </div> <div class="chat chat-start"> <div class="chat-avatar avatar"> <div class="w-10 rounded-full bg-primary"></div> </div> <div class="chat-bubble">I'd be happy to assist you!</div> </div> </div> |
Using Claude Code, Cursor, or another AI editor?
Cherry MCP cung cấp cho trình soạn thảo AI của bạn tên và cấu trúc lớp Trò chuyện chính xác theo yêu cầu. Không còn những lớp học ảo giác nữa.