Agentic UI/MessageBubble

MessageBubble

채팅 메시지를 표시하는 버블 컴포넌트입니다. user, assistant, system 세 가지 역할을 지원합니다.

Installation

bash
npx axis-cli add message-bubble --agentic

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>
  )
}

Interactive Demo

👤
안녕하세요! 오늘 날씨가 어때요?
AM 04:29
🤖
안녕하세요! 오늘 서울은 맑고 기온은 15°C 정도입니다. 야외 활동하기 좋은 날씨네요.
GPT-4oAM 04:30

Roles

User

👤
사용자 메시지입니다.

Assistant

🤖
AI 어시스턴트의 응답입니다.
GPT-4

System

시스템 알림: 새로운 세션이 시작되었습니다.

Props

roleRequired
Type:"user" | "assistant" | "system"

메시지 발신자 역할

contentRequired
Type:React.ReactNode

메시지 내용

timestamp
Type:Date
Default:-

메시지 타임스탬프

avatar
Type:React.ReactNode | string
Default:-

아바타 (ReactNode 또는 이미지 URL)

status
Type:"sending" | "sent" | "error"
Default:-

메시지 전송 상태

actions
Type:React.ReactNode
Default:-

메시지 액션 버튼

metadata
Type:string
Default:-

메타데이터 (모델명 등)

className
Type:string
Default:-

추가 CSS 클래스

Accessibility

메시지는 role="article"로 마크업되고, 작성자(role prop: user/assistant/system)가 aria-label로 식별됩니다.

  • 작성자가 접근 가능한 이름으로 노출됩니다.
  • 장식 요소는 aria-hidden으로 처리됩니다.