All posts
Product design

AI Chat Interface Design: Anatomy, Patterns and Common Mistakes

AI chat interface design: the anatomy of a good chat UI, part by part, the mistakes we see in AI SaaS builds, and React notes for streaming responses.

By Mehdi Hassan8 min read

The short answer

Good AI chat interface design has six parts: a scoped composer with suggested prompts, a readable message thread, distinct thinking and streaming states, inline sources, per-message actions (copy, edit, regenerate, feedback) and conversation management. The common mistakes are a blank input box, one generic spinner, scroll that fights the reader, and no way to stop or recover.

Key takeaways

  • A chat UI has six parts: composer, thread, states, sources, message actions and conversation management.
  • The empty state is the most important screen. Scoped suggestions beat "Ask me anything".
  • Auto-scroll should follow the stream only until the user scrolls up, then stop.
  • Stop must cancel the request on the server, not just hide the text.
  • Render streamed markdown safely: code blocks and tables arrive in fragments.

Part of AI Product UX: How to Design AI Features Users Trust

Chat became the default AI interface because it is easy to ship. That doesn't make it easy to design well. Most AI chat products look alike at first glance, and the differences that matter sit in the details: what the empty state suggests, how the stream scrolls, what happens when the answer is wrong. This guide labels each part of a chat UI, lists the mistakes we see most, and adds notes for building it in React. It belongs to our wider guide on AI product UX.

What are the key parts of an AI chat interface design?

An AI chat interface has six parts: the composer, the message thread, the response states, sources, per-message actions and conversation management. Each part has a job, and most weak chat products skip at least two of them.

Part

What it includes

Its job

1. Composer and empty state

Input, suggested prompts, attachments, mode picker, send and stop

Help users ask well

2. Message thread

User and AI messages, markdown, code, tables

Make long answers readable

3. Response states

Queued, thinking, tool use, streaming, done, failed

Show what the system is doing

4. Sources

Inline citation markers, source panel

Let users check answers

5. Message actions

Copy, edit, regenerate, feedback, share

Make recovery and reuse easy

6. Conversation management

History, rename, search, delete, new chat

Let users return to past work

The empty state belongs with the composer, but it behaves like its own screen, so design it as one. Treat this table as the anatomy diagram for a review: walk through a chat product part by part and note which are missing or weak.

How should the composer and empty state work?

The composer should tell users what they can ask and what the AI can see, and the empty state should offer a few specific starting points. A blank box with "Ask me anything" puts all the work on the user and invites requests the product can't handle.

  • Scoped placeholder: "Ask about your invoices, customers or payouts" beats a generic prompt.
  • Three to five suggested prompts: based on the user's role or current page, and clickable.
  • Visible context: chips that show which files, records or pages the AI will use.
  • Multi-line input: grows with the text, Enter to send and Shift+Enter for a new line, with the shortcut shown.
  • Stop replaces send while a response streams, in the same position, so users find it without looking.

Our guide to inline AI patterns beyond the chatbox covers cases where a chat composer isn't the right entry point at all.

How should the message thread display AI responses?

The message thread should make long, structured answers easy to scan: a comfortable line length, clear separation between user and AI turns, and proper rendering of headings, lists, tables and code. AI answers are often long, so the thread is closer to a document reader than to a messaging app.

Two layout choices make the biggest difference. First, keep line length readable, around the width of a book page, even on wide screens. Second, don't put AI answers in speech bubbles. Bubbles suit short human messages, but they squeeze tables and code. Many strong chat products show the user's message in a subtle bubble and the AI's answer as full-width content.

Rendering details that matter in long answers

Code blocks need a language label, a copy button and horizontal scroll rather than wrapping. Tables need horizontal scroll on mobile and a sticky header on long ones. Headings inside an answer should be smaller than the page's own headings, so a long answer doesn't look like a new page. Links should open in a new tab or a side panel, so the conversation isn't lost.

What loading and streaming states does a chat UI need?

A chat UI needs separate states for queued, thinking, using a tool, streaming text, done and failed. One spinner for all of them tells users nothing, and waiting without information is when they lose patience and trust.

  1. Queued

    The message is sent but the model hasn't started. Show the user's message immediately so the send feels instant.

  2. Thinking

    The model is reasoning before output. A short label like "Thinking" with a subtle animation, optionally expandable to show the steps.

  3. Using a tool

    Name the action: "Searching your documents" or "Reading 3 files". It explains the wait and adds transparency.

  4. Streaming

    Text appears progressively with a cursor or fade, without layout jumps.

  5. Done

    Message actions appear, sources become clickable and focus returns to the composer.

  6. Failed

    Keep partial text, say what failed in plain words and offer retry or continue.

Our guide to AI loading states shows how to design each one, including longer multi-step waits.

How should sources and message actions work?

Sources should appear as small numbered markers next to the claims they support, opening the exact passage in a panel or popover. Message actions should sit under each AI message and include copy, regenerate, edit the prompt, and feedback, visible on hover on desktop and always visible on touch screens.

Citations are the main way a chat UI earns trust for factual answers, so they deserve real design time. Our guide to showing sources and citations in AI answers covers marker styles and source panels. Editing the user's previous message and re-running from there is often the fastest recovery path, and our guide to recovery patterns for AI errors explains how to pair it with regenerate and undo.

What are the most common AI chat UI mistakes?

The most common AI chat UI mistakes are a blank empty state, one generic loading spinner, auto-scroll that drags the reader away, a stop button that doesn't really stop, answers squeezed into bubbles and no way to find old conversations. Each one is cheap to fix during design and expensive after launch.

Mistake

What users experience

Fix

"Ask me anything" empty state

Don't know what to ask

Scoped suggested prompts

One spinner for every wait

No idea if it's stuck

Distinct named states

Forced auto-scroll

Can't read while it streams

Stick to bottom only until user scrolls up

Cosmetic stop button

Text stops, cost doesn't

Abort the request on the server

Answers in narrow bubbles

Tables and code are unreadable

Full-width AI responses

No history or search

Lose past work

Named, searchable conversations

Chat for everything

Too much typing for simple tasks

Use inline actions where they fit

The last row is the strategic one. Our comparison of copilot vs agent vs chat helps decide when chat is the right model, and agentic UX covers what to design when the AI should act, not answer.

How do you build a streaming chat UI in React?

Build a streaming chat UI in React by streaming the response from a server route, appending tokens to the last message in state, rendering only that message on each update, and wiring stop to an abort signal. Most of the difficulty is in scrolling, markdown parsing and failure handling, not in receiving tokens.

  • Stream from the server: a Next.js route handler can return a streamed response, and the client reads it chunk by chunk. Chat SDKs wrap this, but know what they do underneath.
  • Re-render only the active message: memoize finished messages so a long thread doesn't re-render on every token.
  • Abort properly: pass an AbortController signal to the fetch, and cancel the model request on the server when the client disconnects.
  • Smart auto-scroll: track whether the user is near the bottom. Follow the stream only if they are, and show a "jump to latest" button if not.
  • Safe incremental markdown: unclosed code fences and half-finished tables break naive renderers. Render a plain fallback until the block closes.
  • Accessibility: use a polite live region that announces when a response finishes, not every token, and keep focus in the composer.
  • Long threads: virtualize very long conversations so the page stays responsive.

As these pieces repeat across features, turn them into shared components. Our guide to design systems for AI products covers which ones to standardize, and web app UI design covers the surrounding product layout.

Frequently asked questions

Should an AI chat interface use speech bubbles?
Usually not for AI responses. Bubbles work for short human messages, but AI answers often contain lists, tables and code that need full width to be readable. A common pattern is a subtle bubble or background for the user's message and full-width, document-style content for the AI's reply, with clear spacing between turns.
How many suggested prompts should a chat show?
Three to five is a good range. Fewer than three gives users too little to go on, and more than five turns the empty state into a menu people skim past. Base them on the user's role, current page or recent activity where you can, and refresh them as the product learns what people actually ask.
Where should the chat interface live in a SaaS product?
It depends on the job. A full-page chat suits research and open-ended exploration. A side panel suits copilot use, where the user works on something and asks questions about it. A floating launcher suits support. If users need to see their work while chatting, a side panel beats a modal that covers the content.
Should users be able to edit previous messages?
Yes. Editing a previous prompt and re-running from that point is one of the fastest ways to recover from a weak answer. Show that the conversation branches from the edit, and keep the earlier version reachable if the product supports it, so users don't fear losing a good answer while trying a better prompt.
How do you show model or mode selection in a chat UI?
Put it in or next to the composer, labelled by outcome rather than model name where possible, such as "Fast" and "Thorough". Many users don't know model names. Show the current choice on each response if it affects quality or cost, and remember the user's last choice. Hide it entirely if most users never need to change it.

· CEO & Design Director

Copywriter, designer and developer, and founder of Designify Studio. Over five years, 60+ projects across 14+ industries, for startups that have raised $300M+.

Want this done for you? Brand & design sprint, $3,000.

A brand refresh or redesign, plus design explorations for your website and product. $3,000, one-time, fixed price. Book a free 30-minute call to see if it fits.

Schedule Call