Skip to content
caliper ui docs

Pro

Prompt input

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

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

Northwind assistant

Knows your projects, reviews and who is on call

Assistant

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

Enter to send · Shift+Enter for a new line

Installs components/ui/prompt-input.tsxDepends on @radix-ui/react-slot, lucide-reactMotion none in component source

When to use

Use it for

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

Skip it when

  • 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.

Usage

Import it from your copy of the source. The example behind the preview comes with the source.

example.tsx
import { PromptInput } from "@/components/ui/prompt-input"

The worked example comes with Pro

The 72-line example behind the preview opens here, ready to copy.

  • 626 Pro parts, blocks and page templates, all with source
  • $149 once, with lifetime updates. No renewal
  • A full refund within 14 days if it is not for you
Checking your licence…

API reference

PromptInput

component
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—

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.

KeyBehaviour
EnterActivates the focused control.
EscapeCloses or cancels, then returns focus to where it came from.
↑Moves to the previous item or value.
↓Moves to the next item or value.

Motion

It declares no animation in its component source. Any transition comes from its stylesheet, which uses the duration tokens that collapse to instant under prefers-reduced-motion.

All Agent shell examples