480
Sponsor

Chat Message

Chat message bubble with role label, streaming indicator, and collapsible content

Terminal
chat-message-demo
No opentui live preview is registered for this example yet.

Installation

$ pnpm dlx shadcn@latest add @termcn/opentui-chat-message

Usage

import { ChatMessage } from "@/components/ui/chat-message";
<ChatMessage sender="assistant" name="Claude" timestamp={new Date()}>
  Here is the refactored version of your function.
</ChatMessage>

API Reference

ChatMessage

PropTypeDefault
sender"user" | "assistant" | "system" | "error"required
namestring-
timestampDate-
streamingbooleanfalse
collapsedboolean-
childrenReactNode-