Chat Bubble
Message bubble with markdown, avatar tooltips, delivery status, streaming cursor, and inline reactions.
Gallery
Assistant, user with reactions, and system line.
A
Hi! Markdown works here, including inline code and lists:
- First item with a bullet
- Second item
Numbered:
- Step one
- Step two
Fenced block:
ts
const greeting = "hello";console.log(greeting);
And a one-line fence without a language:
text
npm run build
6:14 AM
Y
Sounds good - here's my reply with a read receipt.
6:14 AM
System maintenance in 10 minutes.
default-example.tsx
1"use client";23import { ChatBubble } from "@/registry/ui/chat-bubble";45const ASSISTANT_MARKDOWN_DEMO = `Hi! **Markdown** works here, including \`inline code\` and lists:67- First item with a bullet8- Second item910Numbered:11121. Step one132. Step two1415Fenced block:1617\`\`\`ts18const greeting = "hello";19console.log(greeting);20\`\`\`2122And a one-line fence without a language:2324\`\`\`25npm run build26\`\`\``;2728export function ChatBubbleDefaultExample() {29 return (30 <div className="mx-auto w-full max-w-lg space-y-6 p-4">31 <ChatBubble32 content={ASSISTANT_MARKDOWN_DEMO}33 variant="assistant"34 timestamp={new Date()}35 user={{ id: "1", name: "Assistant" }}36 />37 <ChatBubble38 content="Sounds good - here's my reply with a read receipt."39 variant="user"40 timestamp={new Date()}41 status="read"42 user={{ id: "2", name: "You" }}43 reactions={[44 { emoji: "👍", count: 1, reacted: true },45 { emoji: "🎉", count: 2, reacted: false },46 ]}47 />48 <ChatBubble49 content="System maintenance in 10 minutes."50 variant="system"51 />52 </div>53 );54}
Minimal
Minimal chat bubble with no avatar or reactions.
Y
Sounds good - here's my reply with a read receipt.
6:14 AM
minimal-example.tsx
1"use client";23import { ChatBubble } from "@/registry/ui/chat-bubble";45export function ChatBubbleMinimalExample() {6 return (7 <div className="mx-auto w-full max-w-lg space-y-6 p-4">8 <ChatBubble9 content="Sounds good - here's my reply with a read receipt."10 variant="user"11 timestamp={new Date()}12 status="read"13 user={{ id: "2", name: "You" }}14 reactions={[15 { emoji: "👍", count: 1, reacted: true },16 { emoji: "🎉", count: 2, reacted: false },17 ]}18 />19 </div>20 );21}
Installation & source
Install via the shadcn CLI or copy the registry files manually.
bash
npx shadcn@latest add @tt-ui/chat-bubble
Props
| Name | Type | Default | Description |
|---|---|---|---|
| content | string | - | Markdown body rendered with GFM. |
| variant | "user" | "assistant" | "system" | "user" | Layout and palette; system centers a muted pill. |
| status | MessageStatus | undefined | Optional read receipts for user messages. |