Composer
The input box for agent apps: mentions, skills, a model picker and one Captain switch. Send becomes Stop while it works.
npx shadcn@latest add https://jawadjalal.com/composer/r/composer.jsonComposer is a Captain family piece with its own repo: github.com/jawadjalal/composer. Install it with the command above.
Usage
import { CaptainComposer } from "@/components/captain-composer"
<CaptainComposer
onSubmit={(m) => send(m.text)}
models={[{ id: "opus", label: "Opus 5.5" }]}
/>Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| onSubmit | (message) => void | Text, mentions, attachments, model and the Captain switch. | |
| models | { id, label }[] | The model picker. | |
| triggers | Trigger[] | @ mentions and / skills. | |
| unstyled | boolean | false | Skip the built-in stylesheet. |
Keyboard
- Enter
- Send
- Shift+Enter
- New line
- @ and /
- Open mentions or skills
Accessibility
- A labelled textarea with a listbox for mentions.
- 44px targets on phones.
- Send is aria-disabled until there is text.