Skip to content

ChatMessage

widgetsdisplay

ChatMessage: displays a single chat message with a colored role badge and word-wrapped content text

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

PropTypeRequiredDescription
roleMessageRolerequired
contentstringrequired
timestampDateoptional
#display#chat-message