Magoo Component UI logo Magoo Component UI
← Catalog

Chat Composer

chat-composer molecule experimental

A message input for AI chat with an auto-growing textarea, attach button, and empty-guarded send.

Also in: Forms

The width preview needs a screen wider than the chosen width — use a larger device (or a desktop browser) to see the desktop and tablet layouts.

Default
Enter to send, Shift+Enter for a new line
Ask
Enter to send, Shift+Enter for a new line

Props

NameTypeReq
placeholder string
send_label string

Related components

How to use

behavior.js auto-grows the textarea from its scrollHeight up to data-max-height (200px by default), keeps the send button disabled while the field is empty or whitespace, and sends on Enter (Shift+Enter inserts a newline) or when the send button is pressed. Sending dispatches a bubbling "chat:send" CustomEvent with { value }, clears the field, and refocuses it. The attach button dispatches "chat:attach" for you to open a file picker.

Use cases

form WCAG AA SEO 15 dir: both ai-generated