POLPOUI

ChatInput

Text input with file attachments, drag-and-drop, and send/stop controls.

ChatInput is the standard padded input (centered, max-w-3xl). Must be rendered inside a ChatProvider.

Preview

AI can make mistakes. Verify important information.

Import

import { ChatInput, type ChatInputProps } from "@polpo-ai/chat";

Props

PropTypeDefaultDescription
placeholderstring"Type a message…"Placeholder text for the textarea
hintstringHint text below the input
allowAttachmentsbooleantrueWhether file attachments are enabled
classNamestringAdditional className on the outer wrapper
renderSubmit(props: { isStreaming: boolean; onStop: () => void }) => ReactNodeCustom submit button renderer

Usage

<ChatProvider agent="my-agent">
  <ChatMessages />
  <ChatInput placeholder="Ask anything..." hint="Shift+Enter for newline" />
</ChatProvider>

Custom submit button

<ChatInput
  renderSubmit={({ isStreaming, onStop }) => (
    <button onClick={isStreaming ? onStop : undefined}>
      {isStreaming ? "Stop" : "Send"}
    </button>
  )}
/>

On this page