AI Components
Prompt Input
The message composer, with attachments and a submit button that becomes stop.
Installation
import { ... } from 'nooxit-design-system/components/ai/prompt-input';Notes
Built on Input Group, so it has the 1px
primary focus border of the other text fields.
- Keyboard. Enter sends and Shift+Enter starts a new line. Backspace in an empty field removes the last attachment.
- Attachments. Files come in from the
+menu, by pasting, or by dropping them on the input (or anywhere on the page withglobalDrop).accept,maxFilesandmaxFileSizelimit them, andonErrorreports what was refused.usePromptInputAttachmentsreturns the list; the demo shows it with Attachment. - Submit.
PromptInputSubmitis a primary icon button. Pass it the chatstatus: it sends when ready, shows a Spinner while waiting for the model, and turns into a stop button while the reply streams, if you passonStop. - State outside the input. Wrap the page in
PromptInputProviderwhen controls elsewhere need to read or change the text or the files.
Adapted from AI Elements' Prompt Input.
Source — src/components/ai/prompt-input.tsx