ChatMessage

A chat turn. Yours is a soft bubble; the assistant types, streams its reply, then reveals its actions. AI.

Open playground

Give me three words for a calm interface.

About

ChatMessage is a React component in the AI category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { ChatMessage } from "@ashutoshswamy/smoui" and set role, text, typingMs among its 4 props.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
import { ChatMessage } from "@ashutoshswamy/smoui";

<ChatMessage role="user" text="Give me three words." />
<ChatMessage role="assistant" typingMs={1200} actions text="Quiet, unhurried, precise." />

Props 4

role

Who is speaking.

"user""assistant"
text

Message text.

string
typingMs

Assistant only: show typing dots first, then stream.

numberdefault 0
speed / actions

Characters per second, and whether to show the action row once done.

number / booleandefault 55 / false