Skip to content
synccn

Prompt Input

AI chat composer with attachments, toolbar slot and stop button.

Enter to send, Shift+Enter for a new line. Drop files to attach.

Installation

$ pnpm dlx shadcn@latest add @synccn/prompt-input

First time in this project? Connect synccn with one command.

Usage

import { PromptInput } from "@/components/ui/prompt-input";<PromptInput busy={busy} onSubmit={send} onStop={stop} />

API reference

Generated from the component's TypeScript types, so it always matches the code.

PromptInput

Chat composer for AI products: auto-growing field, attachments, a model picker slot, Enter to send and a stop button while busy.

  • onSubmit
    (message: { text: string; files: File[] }) => void

    Called on send.

  • onStop
    () => void

    Called when stop is pressed while busy.

  • busy
    boolean

    Default false

    Swaps send for stop while a response is generating.

  • placeholder
    string

    Default "Ask anything…"

    Placeholder text.

  • toolbar
    React.ReactNode

    Extra controls beside the attach button, e.g. a model picker.

  • className
    string

    Extra classes for the root element.

Dependencies

Read from the component's imports when the site builds. The CLI installs all of these for you.

Helpers

npm packages

Keyboard

  • EnterSend
  • Shift+EnterNew line

Accessibility

From the source

Read from this component's code when the site builds, so it can't drift.

  • ARIA attributes: aria-label
  • Keys handled: Enter
  • Includes text only screen readers hear