Prompt Input
Design the box where users ask AI for things — with context, attachments and controls visible — so prompts start strong and never get lost.
7 states5 edge casesDesktop + Mobile
01The problem
The prompt box is the first thing users touch in an AI feature, and usually the least designed: a single-line field with a send arrow. Users don't know what the AI can see, what it's good at, or how to give it a file. Long prompts get cramped, Enter sends half-written thoughts, and a failed request throws away what they typed.
02When to use
Use when
- Chat assistants and copilots
- AI features that take a natural-language instruction: generate, summarise, transform
- Search experiences that answer questions
Avoid when
- The task has a small set of known options — buttons or a form are faster than typing.
- The AI acts on a selection with a fixed operation (Summarise this) — use a menu action.
03Recommended UX
Statecraft recommendation
Use an auto-growing multi-line input that shows the context the AI will use (the current document, selected records, attached files) as removable chips above the text, keeps the typed prompt until a response succeeds, and offers 3–4 starter prompts specific to where the user is.
Context chips answer the silent question “what can it see?”, and let users remove context that would mislead the answer.
Auto-growing input makes long, specific prompts comfortable — and specific prompts produce better results.
Starter prompts tied to the current page teach capability far better than generic examples like “Write a poem”.
04Interaction flow
- 01
Focus input
Starter prompts and current context shown.
- 02
Add context
Attach files, mention records with @, or use the selection.
- 03
Write prompt
Input grows; Shift+Enter for new lines.
- 04
Submit
Enter or button; prompt moves into the conversation.
Result
- Response
- Error — prompt restored
- Stopped
05Desktop behaviour
On desktop, the composer sits at the bottom of the conversation or panel, with context chips above the text and controls in a footer row.
Desktop rules
- Enter sends, Shift+Enter adds a line; show the hint once, quietly.
- Context chips above the text: “Q4 pricing page”, “3 selected invoices”, attached files.
- Footer row: attach, @ mention, model or mode selector if relevant, Send.
- Grow to ~8 lines, then scroll inside the input.
06Mobile behaviour
On mobile, the composer sits above the keyboard. Keep controls minimal and make attachments one tap.
Mobile rules
- Return inserts a new line on mobile; a visible Send button submits.
- Collapse context chips to a single “2 items” chip that expands.
- Attach menu offers camera, photos and files.
- Grow up to ~5 lines before scrolling.
07States
Empty
Placeholder states what the AI can help with here; starter prompts visible.
Typing
Send enabled; input grows.
With context
Chips show attached files, selections and mentioned records.
Uploading attachment
Chip shows progress; Send waits or warns.
Submitted
Input clears; Stop available while generating.
Failed
Prompt restored into the input with the error and Retry.
Limit reached
Input disabled with reset time; draft kept.
08Edge cases
EC-01
Request fails
The user sends a long, carefully written prompt and the request errors.
Recommendation
Put the prompt back in the input (or keep it in the message with Retry). Never make users retype.
EC-02
Too much context
Attached files exceed the model's context window.
Recommendation
Warn before sending, show which files fit, and offer to summarise or select parts — don't silently truncate.
EC-03
Accidental send
Enter sends a half-written prompt.
Recommendation
Allow editing the last message and regenerating; on mobile, use Return for new lines.
EC-04
Pasting a large document
The user pastes 40 pages of text into the input.
Recommendation
Convert large pastes into an attachment chip (“Pasted text · 40 pages”) to keep the input usable.
EC-05
Sensitive data
Users paste customer data into prompts.
Recommendation
State the data policy near the input once, and respect workspace settings that block certain data.
09Microcopy
Placeholder
Avoid
“Ask anything…”
Prefer
“Ask about this invoice, or @mention a customer”
Starter prompts
Prefer
“Summarise overdue invoices · Draft a payment reminder · Compare to last quarter”
Context chip
Prefer
“Using: Q4 pricing page ×”
Too much context
Prefer
“These files are too long to use together. Choose up to 3.”
10Accessibility
- The input is a labelled textarea; context chips are a list of buttons with remove labels.
- Starter prompts are buttons that fill the input rather than sending immediately.
- Send has an accessible name and a keyboard shortcut that's documented.
11Developer notes
- 01
Persist the draft per conversation so navigation or failure doesn't lose it.
- 02
Represent context as structured references (document IDs, record IDs, file IDs), not pasted text.
- 03
Count tokens before sending to warn about context limits.
- 04
Debounce draft saves; don't send keystrokes to the server.
12Implementation prompt
For Claude Code, Codex or Cursor
Implement a production-quality AI prompt input. Requirements: - Auto-growing textarea (up to ~8 lines desktop, ~5 mobile), labelled. - Enter sends / Shift+Enter newline on desktop; Return = newline + Send button on mobile. - Context chips above the text for current document, selection, @mentioned records and attachments; removable. - Attachments with upload progress; Send waits or warns while uploading. - Context-specific starter prompts (buttons that fill the input). - Token counting before send; warn and let users choose when context exceeds limits. - Large pastes converted into an attachment chip. - Draft persisted per conversation; restored on failure with Retry. - Limit-reached state with reset time. - Stop available while generating. Do not redesign the existing interface.