Captain UI

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

Usage

import { CaptainComposer } from "@/components/captain-composer"

<CaptainComposer
  onSubmit={(m) => send(m.text)}
  models={[{ id: "opus", label: "Opus 5.5" }]}
/>

Props

PropTypeDefaultWhat it does
onSubmit(message) => voidText, mentions, attachments, model and the Captain switch.
models{ id, label }[]The model picker.
triggersTrigger[]@ mentions and / skills.
unstyledbooleanfalseSkip 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.