ChatMessage
display
ChatMessage: displays a single chat message with a colored role badge and word-wrapped content text
Terminal
$termuijs render chat-message
Installation
$ bunx termuijs add chat-message
Copies the source into src/components/chat-message/ and installs @termuijs/core, @termuijs/widgets.
Usage
ts
import { ChatMessage } from '@termuijs/widgets'ts
new ChatMessage(options: ChatMessageOptions, style: Partial<Style> = {})API Reference
ChatMessage
| Prop | Type | Required | Description |
|---|---|---|---|
role | MessageRole | required | — |
content | string | required | — |
timestamp | Date | optional | — |