React AI chat UI components

12 AI chat UI componentsLive previewFull source in your repo

The interface layer for an LLM product: the prompt box, the thinking state, the model picker and the attachments. Bring your own provider.

Works with

  • React
  • Next.js
  • TypeScript
  • Tailwind CSS

AI prompt input and chat controls

The parts of an AI interface a user actually touches: where they type, what they attach, which model they are talking to, and the button that sets it to work.

Chatbot loading, streaming and voice states

An LLM response takes seconds, not milliseconds. These are the chatbot UI states that fill that gap without making the wait feel broken.

Chat building blocks: inputs, loaders, avatars and notifications

General parts a chat screen is assembled from: a text area and attachments, command search, loading shimmers, avatars for each speaker, a scroll area for long threads, an animated code diff, and toasts for background tasks.

Chatbot UI design: what makes an AI chat interface feel fast

A chatbot UI is the part of an AI product people actually see: the message list, the prompt input, the model picker, the attachments and the states in between. The hard part is not the message bubbles. It is the several seconds between the user pressing enter and the first token arriving, which is far longer than any normal interface delay and outside your control. Everything that makes an AI chat interface feel fast or slow happens in that window.

A plain spinner is the weakest thing you can put in that gap, because it only says that something is happening. A better waiting state suggests the shape of the answer. Animated Loading Skeleton fills the response area with something that reads as text taking form, and Shimmering Skeleton Wrapper does the same around any layout you already have. The eye settles where the answer will appear, so there is no jump when the first token lands. When the wait is mostly searching and reading, say so: AI Typing Indicator names each step, such as Searching the web or Writing, with its own animated icon, and falls back to plain typing dots in a reply bubble.

Once the model calls tools, the wait stops being one thing. An agent might search the web, read a file, run a command and edit code before it answers, and an agent UI that hides all of that behind one spinner asks for blind trust. Show each tool call as its own step with its output, fold finished steps so a long run stays easy to scan, and stop for approval before anything that cannot be undone, such as a push or a payment. AI Agent UI renders that run from a steps array, with terminal output, code diffs and Allow and Deny buttons.

Once tokens start streaming, do not print each chunk the moment it lands. Models send text in uneven bursts, so buffer the chunks and release whole words on a steady beat, a little faster when the buffer runs long. If words fade in, keep the fade short and soft, so the eye reads a sentence forming instead of chasing moving text. Keep the view pinned to the bottom only while the user has not scrolled up to reread something. AI Chat Interface works this way out of the box, with stop, retry and cited web sources around it.

The prompt input carries more weight than its size suggests, because it is on screen at every moment. It has to grow with the content rather than scroll inside a tiny box, take a pasted page of text without breaking the layout, submit on Enter while keeping Shift and Enter for a new line, and make attachments obvious before sending. AI Prompt Input covers all four and hands you the text, the files and the chosen model in one onSubmit call.

Not every AI feature needs a chat. Often it is one action inside a screen you already have: summarize this thread, rewrite this paragraph, generate a title. An AI button is the right shape for that. Mark it with the sparkle people now read as AI, keep the label a plain verb such as Generate, and let the button carry the wait itself: a loading label while the model works, a way to stop, and a clear done or try again at the end, so nobody clicks twice. AI Button switches those states from the promise your onClick returns and hands you an abort signal for the fetch.

Model choice belongs next to the input, not in a settings page. AI Model Selector keeps the active model visible and switchable mid conversation, which matters once a product offers a fast model and a careful one. Show the model name in plain words and keep the list short, because a long picker turns a chat into a configuration screen.

Voice needs one honest signal above all: whether the microphone is listening. That is a privacy question before it is a design one. Voice Reactive Orb reads the microphone through the Web Audio API when you let it, releases the stream as soon as listening stops, and can instead be driven by a level you pass in, such as the volume of a spoken reply. Either way the visual follows real sound rather than a decorative loop.

Keep the interface provider agnostic. None of these components imports a model SDK or handles an API key, so the same chat UI works with the AI SDK, a direct fetch to any provider, or your own endpoint. That keeps the front end useful through the model switch most teams make at least once.

Frequently asked questions

A chatbot UI is the interface layer of a conversational product: the message thread, the prompt input, controls such as a model picker or attach button, and the loading, streaming and voice states. It is separate from the model and the backend, which is why the same chat UI can sit in front of different providers.

No, and that is deliberate. They are the interface layer only, with no provider SDK, no API key handling and no opinion about where your tokens come from. Wire them to the AI SDK, a direct fetch to any provider, or your own endpoint. That keeps them useful when you switch models, which most teams do at least once.

Collect incoming chunks in a buffer and release whole words on a steady beat, instead of printing every chunk as it arrives, because models send text in uneven bursts. If you fade words in, keep the fade short and subtle. Keep the scroll pinned to the bottom only while the user has not scrolled up themselves. AI Chat Interface handles all three for you.

Something that indicates the shape of the answer rather than a generic spinner. A skeleton in the response area works because it puts the user's attention where the text will appear, which removes the jump when streaming starts. Animated Loading Skeleton is built for that, and Shimmering Skeleton Wrapper does the same job around any layout you already have. If the model searches or runs code first, AI Typing Indicator can name each step as it happens.

Keep the run as an ordered list of steps, reasoning and tool calls, and update it as events stream in from your agent. Show each call's arguments and output, fold steps once they finish, and ask the user before a call that changes something outside the app. AI Agent UI takes that list as a steps array, so tool parts from the AI SDK or events from your own backend map straight onto it.

Give the button a plain verb such as Generate or Summarize and the sparkle icon people associate with AI, then let it show the request's progress: a loading state while the model works, a way to stop, and done or try again at the end. With AI Button you return the request's promise from onClick and it switches those states itself, passing an abort signal that cancels the fetch.

Only when you let them use it. By default Voice Reactive Orb asks for the microphone when the user taps to talk, reads the level through the Web Audio API, and releases the stream when listening stops. Pass a level between 0 and 1, or turn on demo mode, and it never touches the microphone. Browsers only grant microphone access on HTTPS or localhost.

ChatGPT Orb uses low power fractal noise inside a circular mask rather than a full scene, and Siri Orb renders a single sphere. Both are far lighter than a general 3D scene, but both still compile shaders before the first frame. If one is the first thing on screen in your app, give it a static fallback for the initial paint.

Where to go next