suiss/ui · AI
Prompt Input
The field people type into to message an agent, with attachments, model menus and a send button.
Prompt Input is the field the person types into to message the agent. It is an Input Group with a textarea, an attach button, the Model Selector menus and a send button. Attached files show as Attachment chips above the text.
Installation
Prompt Input is built with Input Group, Attachment and Dropdown Menu.
Or use the suiss/ui CLI:
Usage
The attach button opens a hidden file input. Show each file as an Attachment in an addon with align="block-start", with a button to remove it.
Put the two Model Selector menus in the block-end addon, between the attach and send buttons. Move ms-auto from the send button to the first menu trigger, so both menus sit next to the send button.
Enter sends the message and Shift+Enter adds a new line:
AI SDK
Send the text and the FileList from the file input.
The route streams the reply with result.toUIMessageStreamResponse().
API Reference
See Input Group, Attachment and Dropdown Menu.
Accessibility
- Give the textarea an accessible name such as "Message", since the placeholder is not a label.
- Name each remove button after its file, such as "Remove settings-page.tsx".
- Disable the send button while the field is empty.
Prompt Input on mobile is built from the same parts as on the web: Input Group, Attachment. The example above is a static demo; connect it to your agent by rendering the same parts from your messages.
Installation
API Reference
See Input Group, Attachment.