Agentic
Composer
Composes plain-text or rich drafts with mentions, slash actions, toolbar pickers, attachments, a working state, and one submission policy.
Usage
Anatomy
The parts and how they nest, taken from the preview above.
Examples
While the agent works
Light travels the rim and Stop replaces Send. The person can keep typing the next message.
Attachments
Files keep their tiles while they upload, and Send waits until every upload finishes.
Mentions and commands
@ adds files and people as chips, and / runs a command on the draft.
Single line
One line for a chat sidebar. It grows into a stacked composer once the draft wraps.
Recommendations
| Guidance | Practice |
|---|---|
| Do | Name the message input and submit action. Preserve the draft when sending fails. |
Usage boundaries
| Guidance | Boundary |
|---|---|
| Scope | Composer owns draft editing and input controls. Use Conversation for message history and auto-scroll, and Message for individual messages. |
| Scope | The caller owns sending, attachments, and retries. Submitting a draft does not prove successful delivery. |
API reference
Public props from @mizen-labs/ui. Use exported prop types for the complete TypeScript contract.
| Prop | Type | Default | Description |
|---|---|---|---|
| | [] | A structured array of text and mention/action parts. Choose controlled or uncontrolled state. |
| | — | Reports input, suggestion selection, history, and reset changes. Update controlled values synchronously. |
| | — | Receives an allowed draft. Draft clearing and transport remain caller-owned. |
| | Contenteditable div | Supply an accessible name. Render a native textarea for plain-text editing; triggers and tokens require contenteditable. |
| | "stacked" | Adaptive actions sit beside a one-line draft, then move below multiline text. |
| | "always" | Shift+Enter inserts a line break. Desktop sends only with a fine pointer. Never leaves Enter for editing. |
| | false | Disable all editing, allow copying without edits, block submission while editing, or permit attachment-only messages. |
| | [] | Configure trigger characters, items, filtering, loading/error status, and optional async query identity. |
| | — | Observe caret-specific queries. Action callbacks remove the query without inserting a token or submitting. |
| | Optional | Compose an anchored listbox, keyboard-highlighted items, and loading or empty feedback. Suggestions retain editor focus. |
| | Text with trigger | Use chip presentation and icons without changing canonical text, IDs, kinds, or metadata. |
| | Optional | Keeps controls outside the draft scroller. |
| | align="start" | Aligns leading or trailing controls in stacked and adaptive layouts. |
| | Optional | A quiet toolbar choice, such as the model or the permission mode. Options can carry an icon, shown on the trigger once chosen, a one-line description, a group heading such as the provider, and efforts: the levels that model's API takes. The chosen row then opens them to the side, and the trigger reads 'Claude Opus 5.5 · High'. learnMoreHref adds a link beside the menu title. |
| | Native button | Supports a rendered Button and obeys the shared submission gate. The default button stays quiet until there is something to send. A local disabled override never bypasses the parent gate. |
| | form / — | Render a div inside another form. Name writes canonical message text to FormData. Form reset restores the initial draft. |
| | — | Extract canonical text, build custom reset/trigger/submit controls, or filter suggestions with locale-aware helpers. |
| | false / English announcement | Configure Enter when an open suggestion list has no selectable items, and customize the live result announcement. |
| | 1–2 / 4–8 / row-based | Configure input growth on the Composer frame. Draft scrolling is capped at half the viewport; actions stay visible. |
| | false | While the agent works on the last message, a band of light travels the rim. It pauses when the draft has keyboard focus and stays still under reduced motion. |
| | undefined | While working, turns the submit button into Stop and keeps Enter from sending. Stopping moves focus to the draft. |
| | undefined | Lists files above the input; place it first inside Composer. |
| | undefined | One file tile: an image thumbnail or its extension, upload progress, and a remove button. |
| | undefined | A quiet row under the composer for where the agent works; group items with ComposerStatusBarGroup. |
| | Optional | A microphone toggle for the toolbar. The app runs speech recognition and puts the words into the draft; the button shows the recording state with aria-pressed. |
| | undefined | Shows "57% context" with a ring. Hovering or pressing it opens a card with used / limit, a bar, and, when passed, input, output, reasoning, and cached tokens. usage takes the AI SDK usage object as is. cost is in currency units; Mizen ships no prices. |