MessageBubble
채팅 메시지를 표시하는 버블 컴포넌트입니다. user, assistant, system 세 가지 역할을 지원합니다.
Installation
bash
npx axis-cli add message-bubble --agenticInteractive Demo
👤
안녕하세요! 오늘 날씨가 어때요?
오후 02:02✓
🤖
안녕하세요! 오늘 서울은 맑고 기온은 15°C 정도입니다. 야외 활동하기 좋은 날씨네요.
GPT-4o오후 02:03
Roles
User
👤
사용자 메시지입니다.
✓
Assistant
🤖
AI 어시스턴트의 응답입니다.
GPT-4
System
시스템 알림: 새로운 세션이 시작되었습니다.
Usage
tsx
import { MessageBubble } from '@axis-ds/agentic-ui'
export function Example() {
return (
<div className="space-y-4">
<MessageBubble
role="user"
content="React 컴포넌트 설계 패턴에 대해 알려주세요."
timestamp={new Date()}
status="sent"
/>
<MessageBubble
role="assistant"
content="React 컴포넌트 설계에는 여러 패턴이 있습니다..."
timestamp={new Date()}
metadata="GPT-4"
/>
</div>
)
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
roleRequired | "user" | "assistant" | "system" | - | 메시지 발신자 역할 |
contentRequired | React.ReactNode | - | 메시지 내용 |
timestamp | Date | - | 메시지 타임스탬프 |
avatar | React.ReactNode | string | - | 아바타 (ReactNode 또는 이미지 URL) |
status | "sending" | "sent" | "error" | - | 메시지 전송 상태 |
actions | React.ReactNode | - | 메시지 액션 버튼 |
metadata | string | - | 메타데이터 (모델명 등) |
className | string | - | 추가 CSS 클래스 |
roleRequiredType:
"user" | "assistant" | "system"메시지 발신자 역할
contentRequiredType:
React.ReactNode메시지 내용
timestampType:
DateDefault:
-메시지 타임스탬프
avatarType:
React.ReactNode | stringDefault:
-아바타 (ReactNode 또는 이미지 URL)
statusType:
"sending" | "sent" | "error"Default:
-메시지 전송 상태
actionsType:
React.ReactNodeDefault:
-메시지 액션 버튼
metadataType:
stringDefault:
-메타데이터 (모델명 등)
classNameType:
stringDefault:
-추가 CSS 클래스