Composer
The one place a question is written: an optional character mark, context chips, the input, and one control.
Install it:
npx shadcn add @ambientui/composerLive
Behavior
- ·ONE CONTROL, TWO MEANINGS: send while idle, Stop while an answer runs. Send only lights up once there is text — the affordance states its own availability. (An orb was tried in this slot and removed: the identity lives in the shell, and a character where a control belongs reads as decoration.)
- ·While an answer is running the same position becomes STOP — one control, two meanings, always the one that applies. Stopping mid-compose cancels cleanly; stopping mid-stream settles what has already arrived, because it was already said.
- ·Every form factor shares this anatomy: `panel` for the in-surface row (panel and dock), `quick` inside quick ask's pill — the pill supplies the glass and the height — and `inline` for a composer standing inside another object (a review thread), which brings its own frame and the smaller type size. The spotlight band is next.
- ·`mark` puts the assistant's CHARACTER at the head of the row, reacting through still / listening / thinking / answer. It is an identity mark, never the control: the send slot stays a control, which is the distinction that made the orb-as-send experiment fail.
- ·The mark DEFAULTS PER VARIANT, not per caller: `panel` carries it because it is the row that stands alone; `quick` does not, because the orb it would duplicate is the pill it sits in; `inline` does not, because it belongs to the object hosting it. Pass `mark` only to override the usual answer.
- ·`suggestion` offers what to do next as ghost text in the empty field, with Tab to accept and run it. The offer stands only while the field is empty — the moment the user types, their words win.
- ·PASTING BULK TEXT ATTACHES IT rather than filling the field (onPasteText). A stack trace dropped into a one-line input buries the question being written under material the user only meant to REFER to; it becomes a MessageAttachments row above the input, removable until the turn is sent. Short pastes stay in the field, because a short paste is almost always part of the sentence being typed.
- ·Context chips ride in compact size ahead of the input; the shimmer placeholder says the assistant is listening.
When to use
- ·Anywhere a question is typed to the assistant — it is the only sanctioned composer.
When not to
- ·For product search or filters; this control promises an AI on the other end.
- ·Never rebuild the input row inline in a surface — that is exactly the drift this extraction removes.