> A component of a Premium AI Canvas design system. Index of every system, component and install setup: https://aicanvas.me/llms.txt

# Prompt Input (Andromeda Pro)

Collects a prompt in a growing field, with its tools and one Send that becomes Stop.

- Design system: [Andromeda Pro](https://aicanvas.me/design-systems/andromeda-pro.md)
- License: Premium (proprietary)
- Install slug: `andromeda-pro-prompt-input`
- Page: https://aicanvas.me/design-systems/andromeda-pro/prompt-input

## Install

```bash
npx shadcn@latest add @aicanvas/andromeda-pro-prompt-input
```

Requires Premium. Without a Premium token the command writes a placeholder instead of the component.

Every Andromeda Pro component at once: `npx shadcn@latest add @aicanvas/andromeda-pro`.

Token setup: the Install section of https://aicanvas.me/llms.txt.

## Props

### PromptInput

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `status?` | `'ready'\|'streaming'` | `'ready'` | `streaming` means the assistant is working: Send becomes Stop (when `onStop` is set) and Enter no longer sends. The field stays writable. |
| `onStop?` | `() => void` |  | Ends the running turn. Called by the Stop button shown in Send's place while `status` is `streaming`. Without it, Send stays in place and dead during a run. |
| `onSubmit?` | `(event: React.FormEvent<HTMLFormElement>) => void` |  | Called when Send is pressed or Enter is typed in the field, with the default already prevented. Never called over an empty field or during a run. |
| `children?` | `React.ReactNode` |  | A PromptInputTextarea followed by a PromptInputToolbar. |
| `className?` | `string` |  | Additional CSS classes applied to the root element. |
| `style?` | `React.CSSProperties` |  | Inline styles applied to the root element. |

### PromptInputTextarea

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `value?` | `string` |  | Controlled value. Pair with onChange. Leave unset for an uncontrolled field (read it from the form on submit; `name` defaults to "message"). |
| `defaultValue?` | `string` |  | Initial value when uncontrolled. |
| `onChange?` | `(event: React.ChangeEvent<HTMLTextAreaElement>) => void` |  | Handler called when the value changes. |
| `maxRows?` | `number` | `10` | The field starts at one line, grows with the words up to this many lines, then scrolls. |
| `placeholder?` | `string` |  | Placeholder text shown when the field is empty. |
| `aria-label?` | `string` | `'Prompt'` | The field's accessible name; it has no visible label. A `label` prop also works and is rendered visually hidden. |
| `name?` | `string` | `'message'` | Form field name, so an uncontrolled field is in the form's FormData. |
| `onKeyDown?` | `(event: React.KeyboardEvent<HTMLTextAreaElement>) => void` |  | Runs before the Enter handling; call preventDefault to keep Enter from sending. |
| `className?` | `string` |  | Forwarded to the <textarea>. |

### PromptInputToolbar

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children?` | `React.ReactNode` |  | Laid out left to right: a PromptInputTools group first, then the right-hand controls (a mic, PromptInputSubmit), which it pushes to the far end. |
| `className?` | `string` |  | Forwarded to the footer row. |
| `style?` | `React.CSSProperties` |  | Forwarded to the footer row. |

### PromptInputTools

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children?` | `React.ReactNode` |  | The left group: an add menu, a model picker, a removable Tag. It takes the free width, so whatever follows it in the toolbar sits at the far end; a Tag inside may shrink. |
| `className?` | `string` |  | Additional CSS classes applied to the root element. |
| `style?` | `React.CSSProperties` |  | Inline styles applied to the root element. |

### PromptInputSubmit

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `size?` | `'sm'\|'md'\|'lg'` | `'sm'` | Rung on the control ladder; match the other controls in the toolbar. |
| `className?` | `string` |  | Additional CSS classes applied to the root element. |
| `style?` | `React.CSSProperties` |  | Inline styles applied to the root element. |

## Remix prompt

The public part of this component's remix prompt. The rest of the build spec is part of Premium.

```markdown
Build **PromptInput**: the box a prompt is written in, a bare growing field on top, a toolbar under an inset divider, and one Send that becomes Stop while the assistant works. React + TypeScript, one file, named exports `PromptInput`, `PromptInputTextarea`, `PromptInputToolbar`, `PromptInputTools`, `PromptInputSubmit`. Use framer-motion for the button gestures and the AI Canvas `arrow-up` and `stop` icons (`@/components/icons/<name>`).

It is drawn to sit on a near-black ground, `oklch(0.135 0.002 286.2)`. Typeface: Manrope, falling back to the system sans. Every part takes `className`, `style` and its element's props, and forwards a ref.

The box is the frame, so the field inside it is bare: a bordered field inside a bordered box is a frame inside a frame. The field gets the whole top row; every control lives in the toolbar, tools on the left, Send at the far end.
```

## More Andromeda Pro components

- [Radio](https://aicanvas.me/design-systems/andromeda-pro/radio.md)
- [Search Field](https://aicanvas.me/design-systems/andromeda-pro/search-field.md)
- [Section Heading](https://aicanvas.me/design-systems/andromeda-pro/section-heading.md)
- [Segmented Control](https://aicanvas.me/design-systems/andromeda-pro/segmented-control.md)
- [Sidebar](https://aicanvas.me/design-systems/andromeda-pro/sidebar.md)
