Skip to content
caliper ui pro docs

Prompt input

A message box with attachments, suggestions, commands and a stop button.

Pro

Assistant

Ask me about your projects, like which one needs attention first.

Enter to send · Shift+Enter for a new line

When to use

  • The user writes to an assistant.
  • You need slash commands, mentions or file attachments.

When not to use

  • It is a short single-line reply; use the thread composer.

Installation

terminal
pnpm dlx shadcn@latest add @caliper/prompt-input

Adds its 3 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.

API reference

PromptInput

14 props
PropTypeDefaultDescription
labelstring"Message"
placeholderstring"Ask anything"
onSubmit *(message: { text: string; files: File[]; }) => void—
onStop(() => void)—Called by the Stop button, and by Escape while streaming.
streamingboolean—While true the send button becomes Stop and Enter does not send.
disabledboolean—
maxLengthnumber—
suggestionsreadonly string[]—Starter prompts shown while the input is empty.
controlsReactNode—Extra controls on the left of the toolbar, such as a model select.
acceptstring—
maxFilesnumber4
maxFileSizenumber5 * 1024 * 1024
allowFilesbooleantrue
classNamestring—

Keyboard

Enter
Activates the focused control.
Escape
Closes or cancels, then returns focus to where it came from.
↑
Moves to the previous item or value.
↓
Moves to the next item or value.

Accessibility

It exposes group and alert semantics, with aria-label, aria-hidden, aria-describedby and aria-live kept in step with state. Changes that matter are announced through a live region.

Notes for AI

Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.

/docs/components/prompt-input.md

The index of every part is at /llms.txt.

More in Agent shell