AI Chat Fancy Stable

ChatMessage

One conversation turn, aligned and dressed by its role, streaming its body while the answer arrives, with an action rail that fades in on hover and a version navigator underneath

Preview

Installation

pnpm add fancy-ui-svelte
import { ChatMessage } from 'fancy-ui-svelte'

Usage

svelte
<script lang="ts">
  import { ChatMessage } from 'fancy-ui-svelte';
</script>

<ChatMessage />

Examples

Basic Usage

Props

PropTypeDefaultDescription
role "user" | "assistant" | "system""assistant"Who produced the turn; drives alignment, chrome, and the accessible name
content string""The body so far, not the latest delta; reassign with a longer string as chunks arrive
streaming booleanfalseWhether content is still growing; shows the trailing cursor
markdown booleanfalseRender the body as markdown instead of a tinted plain-text stream
timestamp Date | number-When the turn was produced; rendered relative, with the exact time as its tooltip

Slots

SlotDescription
avatarRendered beside the body: an image, initials, an icon
childrenReplaces the default body rendering entirely; content is then ignored
actionsThe action rail — put ChatMessageActions here; fades in on hover or focus
footerRendered under the body — where ChatMessageBranches belongs