Prompt Input
Preview

Composable prompt form with text editor, actions, attachments, and submit states.

Overview

PromptInput is a visual form shell for composing chat prompts. It captures prompt text and optional file parts on submit, while the consumer owns sending, cancellation, upload, persistence, and chat state.

PromptInput owns one transient draft for its children. The text editor, attachments, submit button, speech button, and prompt-specific actions coordinate through internal composer state, so consumers do not need to install a prompt-level provider. PromptInputSubmit derives its enabled state from that draft. Omit status or pass null when idle; pass status="processing" or status="streaming" to show a disabled spinner while the runtime is busy.

Usage

import {
  Attachment,
  AttachmentInfo,
  AttachmentPreview,
  AttachmentRemove,
  Attachments,
  Conversation,
  ConversationContent,
  ConversationScrollButton,
  Message,
  MessageContent,
  MessageResponse,
  PromptInput,
  PromptInputActionAddAttachments,
  PromptInputActionMenu,
  PromptInputActionMenuContent,
  PromptInputActionMenuTrigger,
  PromptInputFooter,
  PromptInputSpeechButton,
  PromptInputSubmit,
  PromptInputTextEditor,
  PromptInputTools,
  Shimmer,
  type UIMessage,
  usePromptInputAttachments,
} from "@tilt-legal/cubitt-components/chat-elements";

Examples

Default

Omit status or pass null when idle. Pass status="processing" or status="streaming" to show a disabled spinner in the submit button.

Speech Input

PromptInputSpeechButton writes final and interim speech into PromptInputTextEditor. Use standalone Speech Input when dictation is needed outside a prompt composer.

Attachments

On this page