ValyroUI English version

Prompt Composer

Поле промпта с вложениями. Pro · ИИ: чат и агенты › Промпт и модели

Установка

npx valyro-cli@latest login
npx valyro-cli@latest add prompt-composer
npm install valyro-ui-pro

import 'valyro-ui-pro/styles.css';
import { PromptComposer } from 'valyro-ui-pro';

Пропсы

PropTypeDefault
valuestringControlled value; use with onValueChange.
defaultValuestring''Initial value when uncontrolled.
onValueChange(value: string) => voidCalled with the new value when it changes.
onSend(message: PromptSubmission) => voidEnter (without Shift) or the send button. The composer clears itself afterwards.
loadingbooleanfalseA reply is generating: Enter is ignored and the send button becomes Stop.
onStop() => voidCalled by the Stop button while loading; without it Stop is disabled.
placeholderstring'Ask anything…'Hint text in the empty message field.
disabledbooleanfalseBlocks typing, attaching and sending.
allowAttachmentsbooleantrueAttach files with the paperclip, paste or drag-and-drop. Default true.
acceptstringFile types for the picker, paste and drop — same syntax as <input accept>.
defaultFilesFile[]Files attached on the first render, e.g. a restored draft; later changes are ignored.
onReject(files: File[], reason: PromptRejectReason) => voidFiles that were picked, pasted or dropped but turned away; the composer also shows an inline message.
toolbarReactNodeControls beside the attach button, e.g. a ModelSelector.
maxLengthnumberCharacter limit; shows a counter.
hintReactNodeSmall note next to the send button, e.g. a token estimate.
textareaRefRef<HTMLTextAreaElement>Ref to the inner message <textarea>, e.g. to focus it from outside.
autoFocusbooleanFocuses the message field on mount.
localestringBCP 47 locale for attachment sizes and the character counter; defaults to the ThemeProvider's.
labelsPartial<PromptComposerLabels>Overrides for the built-in English text; keys left out keep their defaults.

Похожие компоненты

Назад: Response Feedback · Далее: Inline Suggestion · Весь раздел «ИИ: чат и агенты»