AI Chat Window
AI chat window. Pro · AI chat and agents › Chat
Installation
npx valyro-cli@latest login
npx valyro-cli@latest add ai-chat-window
npm install valyro-ui-pro
import 'valyro-ui-pro/styles.css';
import { AIChatWindow } from 'valyro-ui-pro';
Props
| Prop | Type | Default | |
|---|---|---|---|
messages * | AIChatMessage[] | Conversation turns in order; an empty list shows the empty state and suggestions. | |
onSend * | (message: PromptSubmission) => void | Called with the composer's text and files, or with a clicked suggestion. | |
loading | boolean | false | A reply is generating: the composer shows Stop. |
onStop | () => void | Called by the composer's Stop button while loading. | |
title | ReactNode | Header title. Defaults to labels.newChat. | |
models | AIModel[] | Shows a ModelSelector in the header. | |
model | string | Controlled model; use with onModelChange. | |
defaultModel | string | Initial model when uncontrolled. | |
onModelChange | (id: string) => void | Called with the new model when it changes. | |
onModelUpgrade | (model: AIModel) => void | Makes plan-locked models in the header selector actionable (see ModelSelector onUpgrade). | |
onNewChat | () => void | Adds a "New chat" button to the header. | |
headerActions | ReactNode | Extra header controls, e.g. a "More" menu. | |
suggestions | string[] | Starter prompts shown while the conversation is empty; clicking one sends it. | |
emptyState | ReactNode | Replaces the default empty-state greeting. | |
placeholder | string | Composer placeholder. Defaults to labels.placeholder. | |
assistantName | string | Name shown on assistant replies. Defaults to labels.assistant. | |
onRegenerate | (messageId: string) => void | Adds Regenerate to the latest assistant reply. | |
onFeedback | (messageId: string, feedback: ChatFeedback) => void | Called when a thumbs up / down on an assistant reply is toggled; null when cleared. | |
locale | string | BCP 47 locale for timestamps, sizes and model metadata; defaults to the ThemeProvider's. | |
labels | Partial<AIChatWindowLabels> | Every string in the window, its messages, composer and model menu. |
Related components
- Chat Message — Messages with streaming output
- Message Branches — Message versions and a conversation branch tree
- Streaming Text — Smooth token streaming
- Markdown Preview — Rendered Markdown
- Response Feedback — Answer rating and a rubric for reviewers
- Prompt Composer — Prompt field with attachments
- Inline Suggestion — Inline autocomplete suggestion
- Model Selector — AI model picker
- Model Comparison — Side-by-side answers from several models
- Prompt Library — Prompt library with variables
- Chain of Thought — Model reasoning steps
- Tool Call — Tool call with approval
Previous: Support Center · Next: Chat Message · All AI chat and agents