The prompt bar is the most used element in any AI product. Every session starts there, and it carries more states than almost any other input on screen. Yet most products design it like a plain text field with a button, and users feel the gaps every day: lost text after an error, no way to stop a long answer, attachments that break the layout on mobile.
A good prompt bar has five parts, about ten states, and clear rules for keyboard, focus and screen readers. This guide walks through each one, with the decisions we made while designing the prompt bar for Nivo UI.
What is a prompt bar?
A prompt bar is the input where a user writes a request to an AI model. It looks like a chat input, but its job is bigger. It grows with long instructions, takes files and images, lets users pick a model or tool, and turns into a stop control while the answer streams.
The difference from a messaging input matters. In a messaging app, people send short lines to other people. In an AI product, people write long, careful instructions, and losing them is painful. So the prompt bar should be treated as a component with its own system, not a text field with a button attached.
Anatomy: the five parts
- Container. The rounded shell that holds everything. It carries the border colour, background and focus ring for each state. Use a large radius (16 to 24px) so it reads as the main input on the page.
- Text area. Auto-growing, from one line up to a set maximum, then it scrolls inside the bar. Use 6 to 8 lines on desktop and 4 to 5 on mobile, so the conversation above stays visible.
- Leading actions. Attach file, add image, tools. Keep this to two visible icons; anything more goes into one menu.
- Trailing actions. Model picker, voice input and the send button. Send is always the last item on the right, because users build muscle memory for where it sits.
- Helper row. An optional line under the bar for a short disclaimer, a character count or an error message.
Keep the send button at least 36px on desktop and 44px on mobile so it is easy to hit with a thumb.
The 10 states a prompt bar needs
Most prompt bars ship with three states: empty, typing and sending. Users hit the other seven every day, and that is where products feel unfinished.
| State | What changes | Send button |
|---|---|---|
| Default (empty) | Placeholder text, neutral border | Disabled |
| Hover | Border darkens slightly | Disabled |
| Focus | Focus ring, caret visible | Disabled until text exists |
| Filled | Text present, placeholder gone | Enabled |
| Multiline | Bar grows upward; actions stay pinned to the bottom | Enabled |
| With attachment | File chip above the text, with a remove button | Enabled |
| Sending | Input locked for a moment | Spinner |
| Streaming | Input free again while the answer generates | Becomes Stop |
| Error | Red border, message in the helper row, text kept | Retry |
| Disabled | Muted colours, no caret (limit reached, offline) | Disabled |
Two rules matter more than the rest.
Never clear the user’s text on error. Losing a long prompt is the fastest way to lose trust. Keep the text exactly as it was, show the reason under the bar, and let the user retry with one click.
Stop must sit exactly where Send was. While an answer streams, users often want to cancel. In the same place, they can cancel without looking.
Placeholder text that actually helps
“Ask anything” is fine for a general assistant. For a focused product, the placeholder should show what good input looks like:
- A design tool: “Describe the screen you want to design”
- A legal tool: “Paste a contract to review”
- A data tool: “Ask a question about your sales data”
Keep it under 40 characters, use medium-contrast gray, and never use it as the only label. It disappears when the user types, so a real label is still needed.
Desktop and mobile behaviour
- Keyboard. On desktop, Enter sends and Shift+Enter adds a new line. On mobile, the return key adds a line and the send button sends.
- Position. On mobile, pin the bar directly above the keyboard and keep the latest message visible. Test on both iOS and Android.
- Actions. On narrow screens, collapse leading actions into one plus button that opens a sheet.
- Height. Lower the maximum height on mobile so the conversation never disappears behind the input.
Accessibility rules
- Give the text area a real label, even if visually hidden, such as “Message”
- Use a focus ring with at least 3:1 contrast against the background, in light and dark mode
- Give every icon button an accessible name: “Attach file”, “Choose model”, “Send message”, “Stop generating”
- Announce streaming status once with a polite live region, not every new word
- Link the error message to the input with
aria-describedby - Keep a logical tab order: leading actions, text area, trailing actions, send
- After sending, return focus to the text area so the user can type the next message
Design tokens to define
Bind every value to a variable so light and dark mode switch cleanly:
| Token | Used for |
|---|---|
background |
Container fill |
control-border |
Default border |
ring |
Focus ring |
destructive |
Error border and text |
foreground |
Typed text |
muted-foreground |
Placeholder and helper text |
primary / primary-foreground |
Send button and its icon |
| radius, padding, control height | Shape and size |
In Nivo UI these map to the same semantic tokens every other input uses, so the prompt bar follows the system instead of being a one-off.
Common mistakes to avoid
- Send button enabled when the input is empty
- Text cleared after an error
- No Stop control while streaming
- Attachments that push the text off screen on mobile
- Hover and focus states that look the same
- Placeholder used as the only label
- Icons without accessible names
- A bar that grows so tall it hides the conversation
Start from a finished prompt bar
Nivo UI includes a prompt bar with all 10 states for desktop and mobile, built on variables with light and dark modes and documented on its own page. It launches free on Figma Community on December 15. Get Nivo UI and skip the setup.
FAQ
What is the difference between a chat input and a prompt bar? A chat input sends short messages to people. A prompt bar sends longer instructions to a model, so it needs multiline growth, attachments, model selection and a stop control.
How tall should a prompt bar be? Start at one line, around 48 to 56px. Grow to 6 to 8 lines on desktop and 4 to 5 on mobile, then scroll inside the bar.
Should Enter send the message? On desktop, yes, with Shift+Enter for a new line. On mobile, use the send button and let return add a line.
How many states does a prompt bar need? About ten: default, hover, focus, filled, multiline, with attachment, sending, streaming, error and disabled.
