Prompt Composer
Prompt Input with everything a real product adds. Files attach by button, drop or paste, and one that is refused says why. Typing / opens commands and @ points the question at a person or document, both driven from the keyboard. `onSubmit` receives text, files, model, mentions and toggles as one object.
Ready for AI tools one file typed props installs by name prompt included
The decision inside it
A refused file says why, and the rest still go through
Too large, the wrong type, one too many: each is named beside the file it applies to. Dropping five files where one is over the limit attaches four and explains the fifth.
Installation
How you get it
Paste this into Claude Code, Cursor, Codex or any coding agent. It installs the file and uses it as it is, instead of writing a new one.
Use Layro's Prompt Composer for this.
Install it: npx shadcn@latest add @layro/prompt-composer
Import it from @/components/ui/prompt-composer.
Do not rewrite or restyle it. Pass my data through its props
and keep its built-in states.For the full brief with every prop and the mistakes assistants usually make, use Copy prompt above. Pro components install through the @layro registry with your CLI token: see the Namespaced tab.
API
“Copy prompt” above puts a full brief on your clipboard — install command, dependencies, props, and the mistakes an assistant usually makes with this component.
Props
Read from the component’s own TypeScript interface when the site is built, so this table cannot drift from the file you install.
| Prop | Type | Notes |
|---|---|---|
onSubmit | (message: ComposerMessage) => void | — |
attach | boolean | Show the attach button and accept dropped and pasted files. Default true. |
defaultAttachments | ComposerAttachment[] | — |
onAttachmentsChange | (attachments: ComposerAttachment[]) => void | — |
accept | string | As for a file input: ".pdf,.csv,image/*". |
maxFiles | number | Default 5. |
maxFileSize | number | Bytes. Default 10 MB. |
models | ComposerModel[] | — |
model | string | — |
defaultModel | string | — |
onModelChange | (id: string) => void | — |
commands | ComposerCommand[] | Opened by typing "/". |
mentions | ComposerMention[] | Opened by typing "@". |
toggles | ComposerToggle[] | — |
defaultToggles | string[] | — |
onTogglesChange | (ids: string[]) => void | — |
Dependencies
npm packages
clsxframer-motionlucide-reacttailwind-mergeLayro foundations, installed alongside it
layro-themebuttondropdown-menuprompt-inputLifetime access
Every component, and everything we ship next.
- All 112 components, source included
- The template, and everything released after you buy
- shadcn CLI or download — React 18/19, Tailwind v4
- One payment. No subscription.
More in AI Chat
All AI Chat componentsSuggested Prompts
PaidStarter questions as cards, chips or a list, with categories and a shuffle.
Included with lifetime access
Conversation History
PaidThe sidebar of past chats: grouped by day, searchable, rename, pin and delete in place.
Included with lifetime access
Memory Manager
PaidWhat an assistant remembers about someone, and the controls to change it.
Included with lifetime access
AI Chat
BlockFreeA whole chat window: greeting, streaming answers, stop, retry and regenerate.
Chatbot
BlockFreeOne chat in four places: a floating widget, an embedded panel, a copilot sidebar or a full page.
Chat Message
FreeOne turn in a conversation, for the person or the assistant, with sources and attachments.