v1.5.4
Theme

Chat

The Chat components provide styled primitives for LLM-oriented conversations: message bubbles, assistant reasoning, tool calls, and typing indicators.

Installation

npm install @duskmoon-dev/el-chat

Usage

import '@duskmoon-dev/el-chat/register';
<el-dm-chat
  align="start"
  color="primary"
  avatar="AI"
  author="Assistant"
  time="Just now"
  status="sent"
  content="I can help with **markdown** content."
>
</el-dm-chat>

Live Demo

Full Conversation

Properties

el-dm-chat and el-dm-chat-bubble

PropertyTypeDefaultDescription
align'start' | 'end''start'Message alignment
color'primary' | 'secondary' | 'tertiary' | 'info' | 'success' | 'warning' | 'error'-Bubble color
size'xs' | 'sm' | 'md' | 'lg'-Bubble size
variant'tonal' | 'filled''tonal'Bubble visual style
streamingbooleanfalseShows a streaming caret
avatarstring-Avatar text fallback
authorstring-Header author text
timestring-Footer timestamp
statusstring-Footer delivery status
actionsstring-Comma-separated icon actions
contentstring-Markdown content to render

el-dm-chat-input

PropertyTypeDefaultDescription
namestring''Form field name
valuestring''Markdown input value
placeholderstring'Send a message... (Ctrl+Enter to send)'Input placeholder
disabledbooleanfalseDisables the input and send
readonlybooleanfalseMakes the input read-only
send-labelstring'Send'Send button label
clear-on-sendbooleanfalseClears the input after sending

el-dm-chat-reasoning

PropertyTypeDefaultDescription
summarystring'Reasoning'Default summary label
openbooleanfalseOpens the details by default

el-dm-chat-tool

PropertyTypeDefaultDescription
namestring-Tool name
status'pending' | 'running' | 'success' | 'error''pending'Tool call status
openbooleanfalseOpens the details by default

Bubble Variants

Bubble Colors

<el-dm-chat-bubble color="primary" content="Primary **markdown** response"></el-dm-chat-bubble>
<el-dm-chat-bubble color="success" content="Success response"></el-dm-chat-bubble>
<el-dm-chat-bubble align="end" color="info" variant="filled" content="Filled info response">
</el-dm-chat-bubble>

Markdown Content

Use the content attribute or property for markdown-rendered message bodies.

Markdown Message

<el-dm-chat
  avatar="AI"
  author="Assistant"
  content="Rendered **markdown** with `inline code`."
></el-dm-chat>

Chat Input

Markdown Chat Input

<el-dm-chat-input
  placeholder="Send a message... (Ctrl+Enter to send)"
  send-label="Send"
  clear-on-send
>
</el-dm-chat-input>

Status and Quick Actions

Message Status and Actions

<el-dm-chat
  avatar="AI"
  author="Assistant"
  time="12:06"
  status="streaming"
  actions="Stop, Copy"
  content="I am writing a response and exposing icon quick actions."
></el-dm-chat>

Reasoning

Reasoning Block

Checked the workspace package list, found the missing docs entry, and added the page under Data Display.

bunx npm-check-updates —removeRangeFound @duskmoon-dev/core 1.17.0
<el-dm-chat-reasoning summary="Reasoning" open>
  Checked package metadata and docs routing before making the change.
  <el-dm-chat-tool slot="tools" name="package-search" status="success" open>
    <code slot="call">bunx npm-check-updates --removeRange</code>
    <code slot="result">Found @duskmoon-dev/core 1.17.0</code>
  </el-dm-chat-tool>
</el-dm-chat-reasoning>

Tool Calls

Tool Call Status

rg “chat” packages/docsdocs build completed
<el-dm-chat-tool name="search" status="running" open>
  <code slot="call">rg "chat" packages/docs</code>
</el-dm-chat-tool>

Slots

ElementSlotDescription
el-dm-chatdefaultMain bubble content
el-dm-chatavatarAvatar shown beside the message
el-dm-chatheaderMetadata above the bubble
el-dm-chatfooterMetadata below the bubble
el-dm-chatactionsCustom quick action controls
el-dm-chat-input-Uses markdown input internally
el-dm-chat-reasoningdefaultReasoning body
el-dm-chat-reasoningsummaryCustom summary content
el-dm-chat-reasoningtoolSingle tool call in reasoning
el-dm-chat-reasoningtoolsTool calls in reasoning
el-dm-chat-tooldefaultExtra tool body content
el-dm-chat-toolnameCustom tool header name
el-dm-chat-toolcallTool call input
el-dm-chat-toolresultTool result output

CSS Parts

PartDescription
chatChat row container
avatarAvatar wrapper
headerHeader metadata
bubbleMessage bubble
footerFooter metadata
statusMessage status
actionsQuick actions wrapper
actionGenerated icon action button
contentRendered markdown content
inputChat input wrapper
editorMarkdown input element
sendSend button
reasoningReasoning details container
bodyReasoning text body
toolsReasoning tool-call wrapper
toolTool details container
typingTyping indicator