Composer

react-fancy
Registry JSON
Why
Composing messages, prompts, or user input requires a container that wires up textarea state, submission, action slots, and keyboard shortcuts without rebuilding form plumbing in every chat, code editor, or assistant surface. Without a unified primitive, you end up redoing Enter-to-submit, Shift+Enter line breaks, auto-focus-on-clear, and action-button layouts across features.
What
Composer is a controlled textarea with integrated submit button and action slot. It accepts value and onChange for state management, onSubmit callback (fired by Enter key without Shift, or Send click), placeholder text, an actions slot (ReactNode for left-aligned buttons or badges), and disabled toggle. It tracks focus and clears after submit via controlled state, and exposes a stable data-react-fancy-composer attribute for agent selection.
How
Import from @particle-academy/react-fancy, wire up <Composer value={msg} onChange={setMsg} onSubmit={handleSend} actions={<AttachButton />} />, and it handles textarea growth, Send button gating (disabled on empty/whitespace), and auto-focus. Agents can read/write the textarea value and trigger submission by targeting the stable data-react-fancy-composer handle.