Composer
moleculesThe chat input: an autoresizing textarea fused with attach and send, Enter or mod+Enter to submit, ↑/↓ prompt history, paste and drop to attach, and an optional toolbar row.
Assistant prompt
toolbarStart / toolbarEnd move attach and send into a row under the field; history browses earlier prompts with ↑/↓; onfiles enables attaching; pasted, dropped or picked files land in bind:attachments.
Layouts
Fused (attach and send inside the field), leading / trailing snippets, rows={3} with resize="top", and submitOn="mod-enter" for multi-line prompts.
@jun
Enter
States
busy while a reply streams, disabled when the session ended, pre-attached files, and a long draft capped by maxHeight.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
value bindable | string | '' | |
onsubmit required | (value: string, files: File[]) => void | — | |
submitOn | 'enter' | 'mod-enter' | 'auto' | 'auto' | `auto`: Enter on fine pointers, mod+Enter on coarse ones. |
placeholder | string | 'Message…' | |
history | string[] | [] | Previous prompts, newest last; ↑/↓ browse them at the text edges. |
attachments bindable | File[] | [] | |
onfiles | (files: File[]) => void | — | |
onremove | (index: number) => void | — | |
accept | string | — | |
busy | boolean | false | |
disabled | boolean | false | |
maxHeight | string | '40vh' | |
rows | number | 1 | |
resize | 'none' | 'top' | 'none' | Manual drag handle on the top edge; `none` hides it. |
segments | (value: string) => TextareaSegment[] | — | Mirror overlay segments, forwarded to the Textarea. |
sendLabel | string | 'Send' | |
attachLabel | string | 'Attach' | |
leading | Snippet | — | |
trailing | Snippet | — | |
toolbarStart | Snippet | — | Either one renders a row under the field: start slot left, end slot then send right. |
toolbarEnd | Snippet | — | |
class | string | '' | |
style | string | '' |