Skip to content
HomeCobalt

Composer

Writes the next message, or a question to an agent: the words, the people, agents, files and commands they name, any files that go with them, and the press that sends them, with a reason whenever it cannot send yet and a Stop while an answer streams.

Examples

A direct message. One row that grows with the text; Enter sends, Shift+Enter starts a line, and the draft is still there after a reload.
    DictationA composer you can talk to. The mic beside Send opens the microphone: Cancel takes the tools' place, a waveform scrolls in from the right, and Stop writes what you said into the field to read before you send.
      In an assistantA research assistant. Type @ to bring in a person, an agent or a file, and / at the start for a command. Files upload as they are added, and Stop ends an answer while it streams.

      States

      Press Send. The first try fails, and the next goes through.

      FailedA send that fails. The draft stays with the reason under the box, and sending again tries again.
      HeldWhen it cannot send, it says why. A conversation that is closed says so in the field, and near the limit a count appears beside Send.

      Press Send. The server answers after 2 seconds.

      PendingA send that waits on the server. The draft stays in the field, read only, and Send shows a spinner in its own box until the answer comes.

      Usage

      Use it when

      • Writing the next message in a Thread.
      • Asking an agent a question that can name people, agents and files, run a command, and stream its answer.

      Use something else when

      • A one-line search or filter. Use Input instead, or CommandPalette.
      • A long form field such as a description. Use Textarea instead, inside a Field.

      Rules

      General

      Content

      Avoid

      Limits

      Install

      npx shadcn@latest add https://kaanarici.com/r/cobalt/composer.json
      import { Composer, ComposerAttach, ComposerAttachments, ComposerInput, ComposerSend, useDraft } from "@/components/cobalt/ui/composer"