Skip to content
Components
@app-studio/components

Chat

A chat composer with file attachments, prompt examples, `@` mentions, suggestions, audio recording and agent controls.

View component source

Import

ts
import { ChatInput } from '@app-studio/components';

New to the library? Complete installation and provider setup first.

Interactive examples

Try the component, then open Code to copy the complete example.

INTERACTIVE EXAMPLE

Loading preview…

Props

Required props are marked below. A dash indicates an unspecified default. Design system configuration can override implementation defaults.

Scroll horizontally to see every column.

ChatInput
PropTypeDefaultDescription
getPendingFiles(() => File[])—Get the pending filesSource
clearPendingFiles(() => void)—Clear the pending filesSource
onSubmit((message: string, options?: { model_name?: string; enable_thinking?: boolean; }) => void)—Callback function when the form is submittedSource
placeholderstring'Type your message… use @ to mention'Placeholder text for the inputSource
loadingbooleanfalseWhether the input is in a loading stateSource
disabledbooleanfalseWhether the input is disabledSource
isDisabledboolean—Whether the input is disabled (camelCase alias for `disabled`)Source
linesnumber—Visible row count for the inputSource
rightElement
View typestring | number | bigint | boolean | import("/Volumes/workspace/open-source/app-studio-components/node_modules/@types/react/index").ReactElement<unknown, string | import("/Volumes/workspace/open-source/app-studio-components/node_modules/@types/react/index").JSXElementConstructor<any>> | Iterable<import("/Volumes/workspace/open-source/app-studio-components/node_modules/@types/react/index").ReactNode> | import("/Volumes/workspace/open-source/app-studio-components/node_modules/@types/react/index").ReactPortal | Promise<string | number | bigint | boolean | import("/Volumes/workspace/open-source/app-studio-components/node_modules/@types/react/index").ReactPortal | import("/Volumes/workspace/open-source/app-studio-components/node_modules/@types/react/index").ReactElement<unknown, string | import("/Volumes/workspace/open-source/app-studio-components/node_modules/@types/react/index").JSXElementConstructor<any>> | Iterable<import("/Volumes/workspace/open-source/app-studio-components/node_modules/@types/react/index").ReactNode> | null | undefined> | null
—Optional right-side affordance rendered inside the inputSource
onKeyDown((e: React.KeyboardEvent) => void)—Optional key handler for the editable areaSource
errorany—Error state or value used by form wrappersSource
isAgentRunningbooleanfalseWhether an agent is currently runningSource
isWorkerRunningboolean—Whether an agent is currently running (alias for `isAgentRunning`)Source
onStopAgent(() => void)—Callback function to stop the agentSource
onStopWorker(() => void)—Callback function to stop the worker (alias for `onStopAgent`)Source
autoFocusbooleantrueWhether to auto focus the inputSource
valuestring—Controlled value for the inputSource
onChange((value: string) => void)—Callback function when the input value changesSource
namestring—Form field name for the value. Applied to the hidden mirror `<textarea>`, so the message is submitted with a surrounding native `<form>` and is addressable via `[name="…"]`.Source
hiddenInputbooleantrueWhether to render the hidden `<textarea>` that mirrors the editable area's text (default `true`). It makes `element.value` work for generic tooling; set to `false` only if the extra node is a problem.Source
onFileBrowse(() => void)—Callback function when the file browser is openedSource
sandboxIdstring—ID of the sandboxSource
onUploadProgress((progress: number) => void)—Callback when file upload progress changesSource
onUploadSuccess((data: any) => void)—Callback when file upload succeedsSource
onUploadError((error: any) => void)—Callback when file upload failsSource
onFileUpload((file: File) => void)—Function to execute file upload. Parent should provide this. Should return an object with a loading property.Source
hideAttachmentsbooleanfalseWhether to hide the attachment buttonSource
enableAudioRecordingbooleanfalseEnable audio recording buttonSource
onAudioRecordingStart(() => void)—Callback when audio recording startsSource
onAudioRecordingStop((audio: Blob) => void)—Callback when audio recording stopsSource
titlestring—Title for the chat inputSource
showGuideTipboolean—Whether to show the guide tipSource
guideVideoUrlstring—URL for the guide videoSource
onGuideClose(() => void)—Callback function when the guide tip is closedSource
promptExamplesPromptExample[][]List of prompt examplesSource
suggestionsSuggestion[][]List of suggestions for auto-completionSource
onPromptExampleSelect((example: PromptExample) => void)—Callback function when a prompt example is selectedSource
mentionData{ id: string; name: string; avatar?: string; description?: string; }[][]Data for mention auto-completionSource
mentionTriggerstring'@'Trigger character for mentions (default: '@')Source
onMentionSelect((mention: { id: string; name: string; avatar?: string; description?: string; }) => void)—Callback function when a mention is selectedSource
errorMessagestring—Error message to display at the bottomSource
sizeSize
"sm""md""lg""xs""xl"
'md'Size of the inputSource
shapeShape
"square""rounded""default"
'rounded'Shape of the inputSource
variantVariant
"outline""default""none"
'default'Variant of the inputSource
viewsChatInputStyles{}Style customizationSource
Common inherited styling props (7)

Scroll horizontally to see every column.

ChatInput inherited
PropTypeDefaultDescription
onClickany—Called when the user activates the component.
mediaRecord<string, CssProps>—See the type and source declaration for this property.
askeyof JSX.IntrinsicElements
"symbol""object""slot""style""title""pattern""form""animate""clipPath""filter""marker""mask""a""abbr""address""area""article""aside""audio""b""base""bdi""bdo""big""blockquote""body""br""button""canvas""caption""center""cite""code""col""colgroup""data""datalist""dd""del""details""dfn""dialog""div""dl""dt""em""embed""fieldset""figcaption""figure""footer""h1""h2""h3""h4""h5""h6""head""header""hgroup""hr""html""i""iframe""img""input""ins""kbd""keygen""label""legend""li""link""main""map""mark""menu""menuitem""meta""meter""nav""noindex""noscript""ol""optgroup""option""output""p""param""picture""pre""progress""q""rp""rt""ruby""s""samp""search""script""section""select""small""source""span""strong""sub""summary""sup""table""template""tbody""td""textarea""tfoot""th""thead""time""tr""track""u""ul""var""video""wbr""webview""svg""animateMotion""animateTransform""circle""defs""desc""ellipse""feBlend""feColorMatrix""feComponentTransfer""feComposite""feConvolveMatrix""feDiffuseLighting""feDisplacementMap""feDistantLight""feDropShadow""feFlood""feFuncA""feFuncB""feFuncG""feFuncR""feGaussianBlur""feImage""feMerge""feMergeNode""feMorphology""feOffset""fePointLight""feSpecularLighting""feSpotLight""feTile""feTurbulence""foreignObject""g""image""line""linearGradient""metadata""mpath""path""polygon""polyline""radialGradient""rect""set""stop""switch""text""textPath""tspan""use""view"
—See the type and source declaration for this property.
themeMode"light" | "dark"
"light""dark"
—See the type and source declaration for this property.
_hoverstring | CssProps—See the type and source declaration for this property.
_activestring | CssProps—See the type and source declaration for this property.
_focusstring | CssProps—See the type and source declaration for this property.

For shared layout, color, and responsive properties, read Styling & composition and Responsive layouts. Additional native element attributes depend on the target platform.

Usage guidance

  • Give controls a visible label or an accessible name, and verify keyboard interaction. See Accessibility.
  • For controlled inputs, update the value from the callback shown in the props table. Keep application state in your component or form library.
  • These previews run in the browser. Check React Native setup for platform requirements and differences.
Browse documentation source