Chatbot UI design for an AI product comes down to eight parts and five states. The parts: a composer that stays in reach, a message list that scrolls on its own, streamed replies with a Stop button, a way to retry or regenerate, citations for anything factual, attachments, suggested prompts and an empty state that says what the assistant can do. The states: thinking, streaming, running a tool, failed and rate limited. Get those right, add sources and a route to a person, make the stream accessible, and you have an AI chat interface people trust. And before any of it, check that chat is the right interface at all, because often it isn't.
I'm a design engineer: I design products and build them in production code, so this covers the screens and the React that runs them. It's part of my product design work.
Anatomy of an AI chat interface
Old chatbot UI guides talk about avatars, bubbles and colour. An AI chat interface carries more, because the reply is generated, slow, sometimes wrong and sometimes acting on someone's behalf. These are the parts I design, in the order people meet them.
Empty state. The first screen does the job of onboarding. It says what the assistant can do, what it can't, and shows three or four suggested prompts taken from real tasks in your product, not "Tell me a joke". Microsoft's Guidelines for Human-AI Interaction start with exactly this: G1, "Make clear what the system can do", and G2, "Make clear how well the system can do what it can do".
Composer. A text area that grows with the text up to a limit, then scrolls inside itself. Enter sends and Shift+Enter adds a line on desktop; on phones the return key adds a line and the Send button sends. Attachments, a model or mode picker if you have one, and Send sit in the same bar. While a reply streams, Send turns into Stop.
Message list. User messages and assistant replies, clearly told apart. AWS's Cloudscape design system, in its generative AI chat pattern, aligns the person's messages to the end and the AI's to the start on a full-page chat, but puts everything on one side with a name or avatar in a narrow side panel. It also keeps the input pinned and lets only the message log scroll.
Message actions. Under each finished reply: copy, regenerate, thumbs up and down, and share if it makes sense. Under the person's own message: edit and resend.
Citations. Numbered markers in the text, linked to a sources list under the reply. Perplexity's help centre describes its answers as including "numbered citations linking to the original sources", which is the pattern people now expect.
Attachments. A file chip in the composer with name, type and a remove button, an upload progress state, and a clear message when a type isn't supported.
Rich output. Code blocks with a copy button, tables that scroll sideways on their own rather than breaking the page, and long documents moved out of the thread (more on that below).
States: thinking, streaming, tool calls, errors and rate limits
Most chat UIs I review look fine in the happy path and fall apart in the other states. I draw each one before I sign off the default.
| State | What the person sees | What they can do |
|---|---|---|
| Submitted, nothing back yet | Their message in the list, a short "Thinking" indicator in the reply slot | Stop |
| Streaming | Text appearing, a cursor or subtle pulse at the end | Stop, scroll up freely |
| Using a tool | A line naming the action: "Searching your orders", "Reading invoice.pdf" | Stop, expand to see inputs |
| Waiting for approval | The proposed action with Approve and Cancel | Approve, edit, cancel |
| Done | The full reply with actions and sources | Copy, regenerate, rate, follow up |
| Failed | A plain error in the reply slot with Retry; the person's message is kept | Retry, edit and resend |
| Rate limited | When they can try again, if you know it | Wait, or switch plan or mode if that exists |
A few rules sit under that table:
- Name the work. Cloudscape's loading states guidance splits a reply into processing (no output yet) and generation (output arriving), and asks for visible loading text that names the thing being made, such as "Generating a response". It also warns against loading states shorter than a second, which only flicker.
- Never lose the person's message on error. The worst failure I see is a 500 that clears the composer. Keep the text, show what went wrong in words, and offer Retry.
- Say when, for rate limits. HTTP 429 Too Many Requests may come with a
Retry-Afterheader. If it does, show the time, not a vague "try later". - Don't steal the scroll. Cloudscape also says not to auto-scroll while someone is reading, scrolling or copying older messages. I follow the stream only when the person is already at the bottom, and show a "Jump to latest" button when they aren't.
- Stop must stop. Stop should cancel the request, keep the partial reply and mark it as stopped, so the person can continue from it or regenerate.
Trust: sources, confidence and a way to a person
People trust an AI chat when they can check it. Three things do most of that work.
Sources beside claims. If the assistant answers from documents, a knowledge base or the web, every factual claim gets a marker, and every marker opens the passage it came from. Microsoft's G11, "Make clear why the system did what it did", is the principle; a source panel is the interface.
Honest uncertainty. When retrieval finds nothing, the reply should say so rather than guess. For actions, I show confidence where the product has a real score, and route low-confidence work to a person. I've written more on this in shipping AI features people trust.
A way out. Support bots need a visible "Talk to a person" that hands over the whole thread, so nobody repeats themselves. Product assistants that act (sending, paying, deleting) need confirmation before the action, scaled by risk; agentic UX design patterns covers that in depth.
Feedback closes the loop. Thumbs up and down on each reply, with an optional reason after a thumbs down, is what Cloudscape documents, including a "Feedback submitted" state so people know it landed.
When chat is the wrong UI
A chat box is the most flexible interface and often the slowest. Before I design one, I ask what the person is trying to finish.
- The task has a fixed shape. Booking, filtering, filling a form. A form with smart defaults beats ten turns of conversation.
- The output is a document, design or code people will edit. Keep it out of the thread. Claude's artifacts open "beside your conversation" for content that is substantial and self-contained, so the chat stays the control and the work has its own space.
- People refine one part. Nielsen Norman Group's study of early generative AI use, Accordion Editing and Apple Picking (2023), found people repeatedly asking for shorter or longer versions and quoting parts of earlier replies to change them. Its advice: let people change just a portion, edit directly and point at what they mean instead of describing it.
- The AI should work in the background. Inline suggestions, a summary at the top of a record or a review queue are often better than a chat window people have to open.
Accessibility: stream politely, focus sensibly
Streaming is the hard part. If every token is added to an aria-live region, a screen reader either chatters through every fragment or drops most of it.
- Mark the transcript as a log. MDN's log role is meant for chat history: new content is added in order, it has an implicit
aria-live="polite", and it needs an accessible name. - Hold announcements while streaming. Set `aria-busy="true"` on the reply while it streams, which tells assistive technology the content isn't finished, then set it to
false. Alongside, I use a separate visually hidden status line that says "Assistant is responding" and then "Response complete", which covers WCAG 2.2 success criterion 4.1.3, Status Messages. - Keep focus in the composer after sending, so a keyboard user can keep typing. Don't move focus into the stream.
- Make everything reachable by keyboard (success criterion 2.1.1): Stop, message actions, citations and the source panel. Escape should stop a stream or close the panel, never both at once.
- Label icon buttons. Copy, regenerate, thumbs and Stop all need text names, and targets of at least 24 by 24 CSS pixels (success criterion 2.5.8).
Mobile chat interfaces
On a phone the keyboard covers half the screen, so the composer has to sit on top of it, not behind it. The viewport meta tag's `interactive-widget` key lets you choose resizes-content, so the layout shrinks when the keyboard opens, in browsers that support it; test on real iOS and Android devices either way. Keep message actions behind a long press or a single "more" button, put Stop where Send was, and make citations open a bottom sheet rather than a new tab.
Building it with the Vercel AI SDK
I build chat front ends in React and Next.js, and the AI SDK UI `useChat` hook maps closely to the states above. Reading its docs on 10 November 2026: status is one of submitted, streaming, ready or error; stop() cancels the request; regenerate() reprocesses the last message; and each message is a list of parts, typed as text, tool calls, reasoning, sources (source-url, source-document) and files. A throttle option limits how often the UI re-renders while text streams.
const { messages, sendMessage, status, stop, regenerate, error } = useChat({
transport: new DefaultChatTransport({ api: '/api/chat' }),
});
const busy = status === 'submitted' || status === 'streaming';
<div role="log" aria-label="Conversation">
{messages.map((m) => (
<article key={m.id} aria-busy={busy && m === messages.at(-1)}>
{m.parts.map((part, i) =>
part.type === 'text' ? <Markdown key={i}>{part.text}</Markdown>
: part.type === 'source-url' ? <Citation key={i} url={part.url} />
: null
)}
</article>
))}
</div>
{error && <p role="alert">That reply failed. <button onClick={() => regenerate()}>Retry</button></p>}
{busy ? <button onClick={() => stop()}>Stop</button> : <SendButton />}The docs recommend showing a generic error with a Retry button that calls regenerate(), and by default mask server error text. Tool parts are where custom UI goes: a card that says what the tool is doing, and an approval step for anything with consequences. I keep the same component names in Figma and in code, so the states I design are the states that ship.
Frequently asked questions
What makes a good chatbot UI?
A pinned composer, a message list that scrolls on its own, visible states for thinking, streaming and errors, a Stop button, sources for factual answers and an empty state that says what the bot can do. Everything else is styling.
What is the difference between a chatbot UI and an AI chat interface?
Older chatbots followed scripted flows with buttons. An AI chat interface shows generated replies that stream, can be wrong, can cite sources and can call tools, so it needs stop, regenerate, citation and tool states that scripted bots never had.
Should an AI chat stream its replies?
Usually, yes, because people start reading sooner. Pair it with Stop, don't auto-scroll when someone has scrolled up, and announce the finished reply to screen readers rather than every fragment.
How do I show sources in an AI chat?
Numbered markers in the text, each linked to a sources list or panel under the reply that shows the title and the passage used. Perplexity and similar products have made this the expected pattern.
When should I not use a chatbot interface?
When the task has a fixed shape, such as a form or a filter, when the output is a document people will edit, or when the AI can work quietly in the background. A form, an editor beside the chat or an inline suggestion is faster.
Can you design and build an AI chat interface for my product?
Yes. I design the chat, its states and its trust features in Figma and build them in TypeScript, React and Next.js. See my product design work.
Sources and method
I searched the keyword on 10 November 2026 and read the top results: mostly lists of chatbot examples and no-code builders, with little on streaming, stopping, citations, tool states or screen readers. I read every source below on 10 November 2026.
- Microsoft, HAX Toolkit, Guidelines for Human-AI Interaction (G1, G2, G11), checked 10 November 2026: microsoft.com
- AWS Cloudscape Design System, Generative AI chat, checked 10 November 2026: cloudscape.design
- AWS Cloudscape Design System, Generative AI loading states, checked 10 November 2026: cloudscape.design
- Perplexity Help Center, How does Perplexity work, checked 10 November 2026: perplexity.ai
- Claude Help Center, What are artifacts and how do I use them, checked 10 November 2026: support.claude.com
- Nielsen Norman Group, Accordion Editing and Apple Picking: Early Generative-AI User Behaviors (2023), checked 10 November 2026: nngroup.com
- MDN, ARIA log role and aria-busy, checked 10 November 2026: developer.mozilla.org
- MDN, 429 Too Many Requests, checked 10 November 2026: developer.mozilla.org
- MDN, viewport meta tag, interactive-widget, checked 10 November 2026: developer.mozilla.org
- W3C, Understanding SC 4.1.3 Status Messages and 2.1.1 Keyboard (WCAG 2.2), checked 10 November 2026: w3.org
- Vercel, AI SDK UI, Chatbot (useChat), checked 10 November 2026: ai-sdk.dev
If you're adding an AI chat to your product and want it designed and built as one piece, book a free 30 minute intro call. After it, you get a written scope and one fixed quote.
Tags: AI chat, Chatbot UI, AI UX, Accessibility, Product design


