For AI agents: the complete documentation index is available at https://wallarm.github.io/design-system/llms.txt, the full documentation bundle is available at https://wallarm.github.io/design-system/llms-full.txt, and this page is available as Markdown at https://wallarm.github.io/design-system/components/chat-input.md.

ChatInput

The composer at the bottom of the Wally chat: a growing textarea where Enter sends and Shift+Enter adds a line, with the send button turning into Stop while a reply streams. It is controlled — the app owns the draft and the running state — and any actions such as ChatPermissions go between the textarea and ChatInputSubmit.

Source · Storybook

Usage

import { ChatInput, ChatInputSubmit, ChatInputTextarea } from '@wallarm-org/design-system/ChatInput';

Examples

Typing

A multi-line draft — the textarea grows with its content up to eight lines, then scrolls.

Streaming

While a reply streams the button becomes Stop; its tooltip mentions that Esc in the textarea does the same.

Disabled

Disabled as a whole, e.g. while the assistant is unavailable.

With context

Attached context sits in a blue bar behind the box; pass context only when there are chips.

With settings

ChatPermissions goes between the textarea and the submit, on the second row.

No disclaimer

disclaimer={null} drops the line under the box.

Analytics

data-analytics-* goes straight on ChatInputTextarea and ChatInputSubmit, which render the real nodes.

Props

PropTypeDefaultDescription
value *stringControlled only — the app owns the draft.
onValueChange *(value: string) => void
onSubmit *(value: string) => voidReceives value.trim(). Not called when the value is empty, while isRunning, or when disabled. The form's native submit is prevented and focus returns to the textarea.
onStop(() => void) | undefinedStop-button click, and Esc in the textarea while isRunning. Inside a Drawer/Dialog that Esc stops the run and doesn't close the layer; no host onEscapeKeyDown is needed. While running, a consumer onKeyDown can't cancel the Esc stop with preventDefault (the textarea has already claimed the key from the layer). Without onStop, Esc is left to the layer. A consumer popup anchored to the textarea (mention/autocomplete) keeps Esc while the textarea has aria-expanded='true'.
isRunningboolean | undefinedfalseSwaps Send for Stop and blocks submit. CopilotKit: agent.isRunning.
disabledboolean | undefinedfalse
contextReactNodeAttached-context chips, shown in a bar behind the box. Nothing to render (null, false, []) hides the bar.
disclaimerReactNodeDEFAULT_DISCLAIMERLine under the box. null/false hides it.
titlestring | undefined
defaultCheckedboolean | undefined
defaultValuestring | number | readonly string[] | undefined
autoFocusboolean | undefined
idstring | undefined
tabIndexnumber | undefined
relstring | undefined
onChangeChangeEventHandler<T, Element> | undefined
namestring | undefined
targetstring | undefined
autoCompletestring | undefined
data-testidstring | undefined

ChatInputSubmit

PropTypeDefaultDescription
sendLabelstring | undefinedSendAccessible name while idle.
stopLabelstring | undefinedStop responseAccessible name and tooltip while isRunning.
titlestring | undefined
defaultCheckedboolean | undefined
defaultValuestring | number | readonly string[] | undefined
autoFocusboolean | undefined
idstring | undefined
tabIndexnumber | undefined
relstring | undefined
onChangeChangeEventHandler<T, Element> | undefined
disabledboolean | undefined
namestring | undefined
valuestring | number | readonly string[] | undefined
data-testidstring | undefined

ChatInputTextarea

PropTypeDefaultDescription
titlestring | undefined
defaultCheckedboolean | undefined
autoFocusboolean | undefined
idstring | undefined
tabIndexnumber | undefined
relstring | undefined
onChangeChangeEventHandler<T, HTMLTextAreaElement> | undefined
disabledboolean | undefined
namestring | undefined
autoCompletestring | undefined
maxLengthnumber | undefined
minLengthnumber | undefined
placeholderstring | undefined
readOnlyboolean | undefined
requiredboolean | undefined
data-testidstring | undefined

Explorer